{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 基于单层决策树(decision stump)构建弱分类器\n",
    "基于单个特征做决策"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "def loadSimpData():\n",
    "    datMat = np.mat([[1. , 2.1],\n",
    "                    [2. , 1.1],\n",
    "                    [1.3, 1. ],\n",
    "                    [1. , 1. ],\n",
    "                    [2. , 1. ]])\n",
    "    classLabels = np.mat([[1.0],[1.0],[-1.0],[-1.0],[1.0]])\n",
    "    return datMat, classLabels"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "def stumpClassify(dataMatrix, dimen, threshVal, threshIneq):\n",
    "    '''\n",
    "    通过阈值比较对数据进行分类\n",
    "    Args:\n",
    "        dataMatrix: 特征数据集\n",
    "        dimen: 可用来进行分类的特征维度\n",
    "        threshVal：进行分类的阈值\n",
    "        threshIneq: 决定如何分类（'lt': 当特征值 <= threshVal 时，为-1类，特征值 > threshVal 时，为1类；\n",
    "                                  'gt'：当特征值 > threshVal 时，为-1类，特征值 <= threshVal 时，为1类）\n",
    "    Return:\n",
    "        retArray: 分类结果\n",
    "    '''\n",
    "    retArray = np.ones((np.shape(dataMatrix)[0], 1))  # m * 1\n",
    "    if threshIneq == 'lt':\n",
    "        retArray[dataMatrix[:,dimen] <= threshVal] = -1.0\n",
    "    else:\n",
    "        retArray[dataMatrix[:,dimen] > threshVal] = -1.0\n",
    "    return np.mat(retArray)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "def buildStump(dataMat, classLabels, D):\n",
    "    '''\n",
    "    单层决策树生成函数(弱学习器)\n",
    "    Args:\n",
    "        dataMat: 特征数据集\n",
    "        classLabels: 分类结果数据集\n",
    "        D: 样本权重向量\n",
    "    Return:\n",
    "        bestStump：最好的单层决策树分类器（划分特征，阈值，划分方式）\n",
    "        minError：最好分类器的加权错误率\n",
    "        bestClasEst：最好的划分结果\n",
    "    '''\n",
    "    m, n = np.shape(dataMat)\n",
    "    numSteps = 10.0\n",
    "    bestStump = {}\n",
    "    bestClasEst = np.mat(np.zeros((m,1)))\n",
    "    minError = np.inf\n",
    "    # 选择最好的单层决策树分类器（只能从某一个特征进行分类）\n",
    "    for i in range(n):\n",
    "        rangeMin = dataMat[:,i].min()\n",
    "        rangeMax = dataMat[:,i].max()\n",
    "        stepSize = (rangeMax - rangeMin) / numSteps\n",
    "        # 从 (rangeMin-stepSize) 到 (rangeMin+10*stepSize) 作为分类阈值点，选取分类效果最好的情况\n",
    "        # （-stepSize是为了保证存在所有点都划分成一个类的情况） \n",
    "        for j in range(-1, int(numSteps)+1):\n",
    "            # 两种划分方式\n",
    "            for inequal in ['lt', 'gt']:\n",
    "                threshVal = (rangeMin + float(j)*stepSize)\n",
    "                predictedVals = stumpClassify(dataMat, i, threshVal, inequal)\n",
    "                errArr = np.mat(np.ones((m,1)))\n",
    "                errArr[predictedVals == classLabels] = 0\n",
    "                # 计算加权错误率\n",
    "                weightedError = D.T * errArr\n",
    "               # print(\"split:dim %d, thresh %.2f, thresh ineqal: %s, the weighted error is %.3f\" % (i, threshVal, inequal, weightedError))\n",
    "                if weightedError < minError:\n",
    "                    minError = weightedError\n",
    "                    bestClasEst = predictedVals.copy()\n",
    "                    bestStump['dim'] = i\n",
    "                    bestStump['thresh'] = threshVal\n",
    "                    bestStump['ineq'] = inequal\n",
    "    return bestStump, minError[0,0], bestClasEst"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "({'dim': 0, 'ineq': 'lt', 'thresh': 1.3}, 0.2, matrix([[-1.],\n",
       "         [ 1.],\n",
       "         [-1.],\n",
       "         [-1.],\n",
       "         [ 1.]]))"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "D = np.mat(np.ones((5,1))/5)\n",
    "dataMat, classLabels = loadSimpData()\n",
    "buildStump(dataMat, classLabels, D)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "错误率： $ \\epsilon $ <br/>\n",
    "alpha: $ \\alpha = \\frac{1}{2} \\ln(\\frac{1-\\epsilon}{\\epsilon}) $ <br/>\n",
    "正确分类的样本权重更新： $ D_i^{(t+1)} = \\frac{D_i^{(t)}e^{- \\alpha}}{Sum(D)} $ <br/><br/>\n",
    "错误分类的样本权重更新： $ D_i^{(t+1)} = \\frac{D_i^{(t)}e^{\\alpha}}{Sum(D)} $ <br/>\n",
    "$ t $ 是上一次，$ t + 1 $ 是此次"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "def adaBoostTrainDS(dataMat, classLabels, numIt = 40):\n",
    "    '''\n",
    "    基于单层决策树的AdaBoost训练\n",
    "    Args:\n",
    "        dataMat: 特征数据集\n",
    "        classLabels: 分类结果数据集\n",
    "        numIt: 最多迭代次数\n",
    "    Return:\n",
    "        \n",
    "    '''\n",
    "    weakClassArr = []\n",
    "    m = np.shape(dataMat)[0]\n",
    "    D = np.mat(np.ones((m,1))/m)\n",
    "    aggClassEst = np.mat(np.zeros((m,1)))\n",
    "    for i in range(numIt):\n",
    "        bestStump, error, classEst = buildStump(dataMat, classLabels, D)\n",
    "        print(\"D: \", D.T)\n",
    "        alpha = np.float(0.5 * np.log((1.0-error)/ max(error, 1e-16)))\n",
    "        bestStump['alpha'] = alpha\n",
    "        weakClassArr.append(bestStump)\n",
    "        print(\"classEst: \", classEst.T)\n",
    "        # 为下一次迭代计算D\n",
    "        # 对正确分类或错误分类同时计算D\n",
    "        # np.multiply对应元素相乘\n",
    "        expon = np.multiply(-1 * alpha * classLabels, classEst)\n",
    "        D = np.multiply(D, np.exp(expon))\n",
    "        D = D/D.sum()\n",
    "        # 错误率累加计算\n",
    "        aggClassEst += alpha * classEst\n",
    "        print(\"aggClassEst: \", aggClassEst.T)\n",
    "        aggErrors = np.multiply(np.sign(aggClassEst) != classLabels, np.ones((m,1)))\n",
    "        errorRate = aggErrors.sum() / m\n",
    "        print(\"total error: \", errorRate, \"\\n\")\n",
    "        if errorRate == 0.0:\n",
    "            break\n",
    "    return weakClassArr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "D:  [[0.2 0.2 0.2 0.2 0.2]]\n",
      "classEst:  [[-1.  1. -1. -1.  1.]]\n",
      "aggClassEst:  [[-0.69314718  0.69314718 -0.69314718 -0.69314718  0.69314718]]\n",
      "total error:  0.2 \n",
      "\n",
      "D:  [[0.5   0.125 0.125 0.125 0.125]]\n",
      "classEst:  [[ 1.  1. -1. -1. -1.]]\n",
      "aggClassEst:  [[ 0.27980789  1.66610226 -1.66610226 -1.66610226 -0.27980789]]\n",
      "total error:  0.2 \n",
      "\n",
      "D:  [[0.28571429 0.07142857 0.07142857 0.07142857 0.5       ]]\n",
      "classEst:  [[1. 1. 1. 1. 1.]]\n",
      "aggClassEst:  [[ 1.17568763  2.56198199 -0.77022252 -0.77022252  0.61607184]]\n",
      "total error:  0.0 \n",
      "\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "[{'alpha': 0.6931471805599453, 'dim': 0, 'ineq': 'lt', 'thresh': 1.3},\n",
       " {'alpha': 0.9729550745276565, 'dim': 1, 'ineq': 'lt', 'thresh': 1.0},\n",
       " {'alpha': 0.8958797346140273, 'dim': 0, 'ineq': 'lt', 'thresh': 0.9}]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "adaBoostTrainDS(dataMat, classLabels, 9)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "def adaClassify(dataMatrix, classifierArr):\n",
    "    '''AdaBoost分类函数'''\n",
    "    m = np.shape(dataMatrix)[0]\n",
    "    aggClassEst = np.mat(np.zeros((m,1)))\n",
    "    for i in range(len(classifierArr)):\n",
    "        classEst = stumpClassify(dataMatrix, classifierArr[i]['dim'],\n",
    "                                classifierArr[i]['thresh'],\n",
    "                                classifierArr[i]['ineq'])\n",
    "        aggClassEst += classifierArr[i]['alpha'] *classEst\n",
    "        #print(aggClassEst)\n",
    "    return np.sign(aggClassEst)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "D:  [[0.2 0.2 0.2 0.2 0.2]]\n",
      "classEst:  [[-1.  1. -1. -1.  1.]]\n",
      "aggClassEst:  [[-0.69314718  0.69314718 -0.69314718 -0.69314718  0.69314718]]\n",
      "total error:  0.2 \n",
      "\n",
      "D:  [[0.5   0.125 0.125 0.125 0.125]]\n",
      "classEst:  [[ 1.  1. -1. -1. -1.]]\n",
      "aggClassEst:  [[ 0.27980789  1.66610226 -1.66610226 -1.66610226 -0.27980789]]\n",
      "total error:  0.2 \n",
      "\n",
      "D:  [[0.28571429 0.07142857 0.07142857 0.07142857 0.5       ]]\n",
      "classEst:  [[1. 1. 1. 1. 1.]]\n",
      "aggClassEst:  [[ 1.17568763  2.56198199 -0.77022252 -0.77022252  0.61607184]]\n",
      "total error:  0.0 \n",
      "\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "matrix([[-1.]])"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dataMat, labelMat = loadSimpData()\n",
    "classifierArr = adaBoostTrainDS(dataMat, labelMat, 30)\n",
    "adaClassify(np.mat([[0,0]]), classifierArr)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "matrix([[ 1.],\n",
       "        [-1.]])"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "adaClassify(np.mat([[5,5],[0,0]]), classifierArr)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 例子：在一个难数据集上应用AdaBoost"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "def loadDataSet(filename):\n",
    "    '''加载数据'''\n",
    "    dataMat = []\n",
    "    labelMat = []\n",
    "    with open(filename) as fr:\n",
    "        for idx, line in enumerate(fr):\n",
    "            line = line.strip().split('\\t')\n",
    "            if idx == 0:\n",
    "                numFeat = len(line)\n",
    "            line = list(map(float, line))\n",
    "            dataMat.append(line[:-1])\n",
    "            labelMat.append([line[-1]])\n",
    "    return np.mat(dataMat), np.mat(labelMat)                "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "D:  [[0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448]]\n",
      "classEst:  [[-1.  1.  1.  1.  1.  1.  1.  1. -1. -1.  1.  1.  1.  1.  1. -1. -1.  1.\n",
      "   1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1. -1. -1.\n",
      "   1. -1.  1.  1. -1.  1.  1. -1. -1. -1. -1.  1.  1. -1.  1.  1.  1.  1.\n",
      "   1.  1.  1. -1. -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1. -1.  1.  1.  1.  1. -1.  1. -1.  1.  1. -1.  1.  1. -1.  1.  1.  1.\n",
      "   1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1. -1.  1.  1.  1.\n",
      "  -1.  1.  1.  1.  1.  1. -1.  1.  1.  1. -1.  1.  1. -1.  1. -1.  1.  1.\n",
      "  -1. -1.  1.  1.  1.  1.  1. -1. -1. -1.  1.  1.  1.  1.  1. -1.  1.  1.\n",
      "   1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.\n",
      "  -1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1. -1.  1.  1. -1. -1. -1. -1.\n",
      "   1. -1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1. -1.  1.  1.  1.  1.  1.\n",
      "   1.  1. -1.  1.  1. -1. -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1. -1.  1. -1. -1.  1.  1.  1.\n",
      "  -1.  1.  1.  1. -1. -1.  1. -1.  1.  1. -1. -1. -1. -1.  1.  1.  1.  1.\n",
      "  -1. -1. -1.  1.  1.  1.  1. -1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.\n",
      "  -1. -1. -1.  1. -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.\n",
      "   1.  1.  1. -1.  1.  1.  1. -1. -1.  1.  1.]]\n",
      "aggClassEst:  [[-0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238 -0.46166238 -0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238 -0.46166238 -0.46166238  0.46166238\n",
      "   0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238  0.46166238  0.46166238  0.46166238 -0.46166238 -0.46166238\n",
      "   0.46166238 -0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238\n",
      "   0.46166238 -0.46166238 -0.46166238 -0.46166238 -0.46166238  0.46166238\n",
      "   0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238 -0.46166238 -0.46166238 -0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238 -0.46166238\n",
      "   0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238  0.46166238 -0.46166238\n",
      "   0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238  0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238\n",
      "   0.46166238 -0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238 -0.46166238 -0.46166238 -0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238 -0.46166238\n",
      "   0.46166238  0.46166238 -0.46166238 -0.46166238 -0.46166238 -0.46166238\n",
      "   0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238\n",
      "  -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238 -0.46166238\n",
      "  -0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238  0.46166238 -0.46166238\n",
      "   0.46166238 -0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238  0.46166238  0.46166238  0.46166238 -0.46166238 -0.46166238\n",
      "   0.46166238 -0.46166238  0.46166238  0.46166238 -0.46166238 -0.46166238\n",
      "  -0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238 -0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238 -0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238 -0.46166238 -0.46166238  0.46166238 -0.46166238 -0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238\n",
      "   0.46166238 -0.46166238 -0.46166238  0.46166238  0.46166238]]\n",
      "total error:  0.2842809364548495 \n",
      "\n",
      "D:  [[0.00233645 0.00588235 0.00233645 0.00588235 0.00588235 0.00233645\n",
      "  0.00233645 0.00588235 0.00233645 0.00588235 0.00233645 0.00233645\n",
      "  0.00233645 0.00588235 0.00233645 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00588235 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00233645 0.00588235 0.00233645\n",
      "  0.00233645 0.00588235 0.00233645 0.00233645 0.00588235 0.00233645\n",
      "  0.00588235 0.00588235 0.00233645 0.00588235 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00233645 0.00588235 0.00233645\n",
      "  0.00588235 0.00233645 0.00233645 0.00588235 0.00233645 0.00233645\n",
      "  0.00588235 0.00588235 0.00233645 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00588235 0.00588235 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00233645 0.00588235 0.00233645\n",
      "  0.00588235 0.00233645 0.00588235 0.00588235 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00588235 0.00233645 0.00233645\n",
      "  0.00233645 0.00588235 0.00233645 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00588235 0.00233645 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00588235 0.00588235 0.00233645 0.00233645 0.00588235\n",
      "  0.00588235 0.00233645 0.00233645 0.00588235 0.00588235 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00233645 0.00588235 0.00233645\n",
      "  0.00588235 0.00588235 0.00588235 0.00233645 0.00588235 0.00588235\n",
      "  0.00233645 0.00233645 0.00233645 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00588235 0.00233645 0.00233645 0.00588235\n",
      "  0.00233645 0.00233645 0.00588235 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00233645 0.00233645 0.00233645\n",
      "  0.00588235 0.00233645 0.00233645 0.00588235 0.00588235 0.00233645\n",
      "  0.00233645 0.00233645 0.00588235 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00588235 0.00233645 0.00588235 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00588235 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00233645 0.00588235 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00588235 0.00588235 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00588235 0.00233645 0.00588235\n",
      "  0.00233645 0.00588235 0.00588235 0.00588235 0.00233645 0.00588235\n",
      "  0.00588235 0.00233645 0.00233645 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00588235 0.00233645 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00588235 0.00233645 0.00233645\n",
      "  0.00233645 0.00588235 0.00233645 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00588235 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00233645 0.00233645 0.00588235\n",
      "  0.00233645 0.00588235 0.00233645 0.00588235 0.00588235 0.00588235\n",
      "  0.00588235 0.00588235 0.00233645 0.00588235 0.00588235 0.00233645\n",
      "  0.00588235 0.00588235 0.00233645 0.00233645 0.00233645 0.00233645\n",
      "  0.00588235 0.00233645 0.00233645 0.00233645 0.00233645 0.00588235\n",
      "  0.00588235 0.00588235 0.00233645 0.00588235 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00233645 0.00588235 0.00588235\n",
      "  0.00233645 0.00233645 0.00233645 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00588235 0.00233645 0.00588235 0.00233645\n",
      "  0.00588235 0.00233645 0.00233645 0.00233645 0.00588235]]\n",
      "classEst:  [[ 1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.\n",
      "   1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1. -1.\n",
      "   1. -1.  1.  1. -1.  1.  1.  1. -1. -1. -1.  1. -1. -1.  1.  1.  1.  1.\n",
      "  -1.  1.  1.  1. -1. -1.  1.  1. -1. -1.  1.  1. -1.  1. -1.  1.  1.  1.\n",
      "   1. -1.  1.  1.  1.  1.  1. -1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.\n",
      "  -1. -1.  1.  1.  1.  1.  1. -1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "  -1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1.\n",
      "   1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1. -1. -1.  1. -1.\n",
      "   1.  1.  1. -1.  1.  1. -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1. -1.  1.  1. -1.  1.  1. -1. -1. -1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1. -1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1. -1. -1.  1.\n",
      "   1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "  -1.  1.  1.  1.  1. -1.  1.  1.  1. -1.  1. -1.  1.  1. -1.  1.  1.  1.\n",
      "  -1.  1.  1.  1.  1. -1.  1.  1.  1.  1. -1.  1.  1.  1.  1. -1.  1.  1.\n",
      "   1.  1.  1.  1. -1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1. -1.  1.  1.  1.  1.  1.  1.  1. -1. -1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1. -1.  1.  1.  1. -1.  1. -1.  1.  1.]]\n",
      "aggClassEst:  [[-0.14917993  0.77414483  0.77414483  0.77414483  0.14917993  0.77414483\n",
      "   0.77414483  0.77414483 -0.14917993 -0.14917993  0.77414483  0.77414483\n",
      "   0.77414483  0.77414483  0.77414483 -0.14917993 -0.77414483  0.77414483\n",
      "   0.77414483  0.14917993 -0.14917993  0.77414483  0.77414483  0.77414483\n",
      "   0.77414483  0.77414483  0.77414483  0.77414483  0.77414483  0.77414483\n",
      "  -0.77414483  0.77414483  0.77414483  0.77414483 -0.14917993 -0.77414483\n",
      "   0.77414483 -0.77414483  0.77414483  0.77414483 -0.77414483  0.77414483\n",
      "   0.77414483 -0.14917993 -0.77414483 -0.77414483 -0.77414483  0.77414483\n",
      "   0.14917993 -0.77414483  0.77414483  0.77414483  0.77414483  0.77414483\n",
      "   0.14917993  0.77414483  0.77414483 -0.14917993 -0.77414483 -0.77414483\n",
      "   0.77414483  0.77414483  0.14917993  0.14917993  0.77414483  0.77414483\n",
      "   0.14917993  0.77414483  0.14917993  0.77414483  0.77414483  0.77414483\n",
      "   0.77414483 -0.77414483  0.77414483  0.77414483  0.77414483  0.77414483\n",
      "  -0.14917993  0.14917993 -0.14917993  0.77414483  0.77414483 -0.77414483\n",
      "   0.77414483  0.77414483 -0.14917993  0.77414483  0.77414483  0.77414483\n",
      "   0.14917993  0.14917993  0.77414483 -0.14917993  0.77414483  0.77414483\n",
      "   0.77414483  0.14917993  0.77414483  0.14917993  0.77414483 -0.14917993\n",
      "   0.77414483  0.77414483 -0.14917993  0.77414483  0.77414483  0.77414483\n",
      "  -0.77414483  0.77414483  0.14917993  0.77414483  0.77414483  0.77414483\n",
      "  -0.14917993  0.77414483  0.77414483  0.77414483 -0.14917993  0.77414483\n",
      "   0.77414483 -0.77414483  0.77414483 -0.14917993  0.77414483  0.77414483\n",
      "  -0.14917993 -0.14917993  0.77414483  0.77414483  0.77414483  0.77414483\n",
      "   0.77414483 -0.77414483 -0.14917993 -0.14917993  0.77414483  0.77414483\n",
      "   0.77414483  0.77414483  0.14917993 -0.77414483  0.77414483  0.14917993\n",
      "   0.77414483  0.77414483  0.77414483  0.14917993  0.77414483  0.77414483\n",
      "  -0.77414483  0.14917993  0.77414483  0.77414483  0.77414483  0.77414483\n",
      "   0.77414483  0.77414483  0.77414483 -0.14917993  0.77414483  0.77414483\n",
      "  -0.14917993  0.77414483  0.14917993  0.77414483  0.77414483  0.14917993\n",
      "  -0.14917993  0.77414483  0.14917993  0.14917993  0.14917993 -0.14917993\n",
      "   0.77414483  0.77414483 -0.14917993 -0.14917993 -0.14917993 -0.14917993\n",
      "   0.77414483 -0.77414483  0.77414483  0.77414483  0.14917993  0.77414483\n",
      "   0.77414483  0.77414483  0.77414483  0.77414483 -0.14917993  0.77414483\n",
      "  -0.77414483  0.77414483  0.77414483  0.14917993  0.14917993  0.77414483\n",
      "   0.77414483  0.77414483 -0.14917993  0.77414483  0.77414483 -0.14917993\n",
      "  -0.14917993 -0.14917993  0.77414483  0.14917993  0.77414483  0.77414483\n",
      "   0.77414483  0.77414483  0.77414483  0.77414483  0.77414483  0.77414483\n",
      "   0.14917993  0.77414483  0.77414483 -0.14917993  0.77414483  0.14917993\n",
      "   0.77414483  0.77414483  0.77414483  0.14917993  0.77414483 -0.77414483\n",
      "   0.77414483 -0.14917993 -0.77414483  0.77414483  0.77414483  0.77414483\n",
      "  -0.77414483  0.77414483  0.77414483  0.77414483 -0.14917993 -0.77414483\n",
      "   0.77414483 -0.14917993  0.77414483  0.77414483 -0.77414483 -0.14917993\n",
      "  -0.14917993 -0.14917993  0.77414483  0.14917993  0.77414483  0.77414483\n",
      "  -0.14917993 -0.14917993 -0.14917993  0.77414483  0.14917993  0.77414483\n",
      "   0.14917993 -0.14917993  0.77414483  0.77414483 -0.14917993  0.77414483\n",
      "   0.77414483  0.77414483  0.77414483  0.77414483  0.77414483  0.77414483\n",
      "  -0.14917993 -0.14917993 -0.77414483  0.77414483 -0.14917993 -0.14917993\n",
      "   0.77414483  0.77414483  0.77414483  0.77414483  0.14917993  0.14917993\n",
      "   0.77414483  0.77414483  0.77414483 -0.14917993  0.77414483  0.77414483\n",
      "   0.77414483  0.77414483  0.14917993 -0.14917993  0.77414483  0.77414483\n",
      "   0.14917993 -0.14917993 -0.77414483  0.77414483  0.77414483]]\n",
      "total error:  0.2842809364548495 \n",
      "\n",
      "D:  [[0.00335068 0.00843582 0.00179355 0.00843582 0.00451553 0.00179355\n",
      "  0.00179355 0.00843582 0.00335068 0.00451553 0.00179355 0.00179355\n",
      "  0.00179355 0.00843582 0.00179355 0.00335068 0.00179355 0.00179355\n",
      "  0.00179355 0.00335068 0.00451553 0.00179355 0.00179355 0.00179355\n",
      "  0.00179355 0.00179355 0.00179355 0.00179355 0.00843582 0.00179355\n",
      "  0.00179355 0.00843582 0.00179355 0.00179355 0.00451553 0.00179355\n",
      "  0.00843582 0.00843582 0.00179355 0.00843582 0.00179355 0.00179355\n",
      "  0.00179355 0.00335068 0.00179355 0.00179355 0.00843582 0.00179355\n",
      "  0.00451553 0.00179355 0.00179355 0.00843582 0.00179355 0.00179355\n",
      "  0.00451553 0.00843582 0.00179355 0.00335068 0.00179355 0.00179355\n",
      "  0.00179355 0.00179355 0.00451553 0.00451553 0.00179355 0.00179355\n",
      "  0.00335068 0.00179355 0.00335068 0.00179355 0.00843582 0.00179355\n",
      "  0.00843582 0.00179355 0.00843582 0.00843582 0.00179355 0.00179355\n",
      "  0.00335068 0.00335068 0.00335068 0.00179355 0.00179355 0.00179355\n",
      "  0.00179355 0.00179355 0.00335068 0.00843582 0.00179355 0.00179355\n",
      "  0.00335068 0.00451553 0.00179355 0.00335068 0.00179355 0.00179355\n",
      "  0.00179355 0.00451553 0.00179355 0.00335068 0.00179355 0.00335068\n",
      "  0.00179355 0.00179355 0.00335068 0.00179355 0.00179355 0.00179355\n",
      "  0.00179355 0.00843582 0.00451553 0.00179355 0.00179355 0.00843582\n",
      "  0.00451553 0.00179355 0.00179355 0.00843582 0.00451553 0.00179355\n",
      "  0.00179355 0.00179355 0.00179355 0.00335068 0.00843582 0.00179355\n",
      "  0.00451553 0.00451553 0.00843582 0.00179355 0.00843582 0.00843582\n",
      "  0.00179355 0.00179355 0.00335068 0.00335068 0.00179355 0.00179355\n",
      "  0.00179355 0.00179355 0.00451553 0.00179355 0.00179355 0.00451553\n",
      "  0.00179355 0.00179355 0.00843582 0.00335068 0.00179355 0.00179355\n",
      "  0.00179355 0.00335068 0.00179355 0.00179355 0.00179355 0.00179355\n",
      "  0.00843582 0.00179355 0.00179355 0.00451553 0.00843582 0.00179355\n",
      "  0.00335068 0.00179355 0.00451553 0.00179355 0.00179355 0.00335068\n",
      "  0.00335068 0.00179355 0.00451553 0.00335068 0.00451553 0.00335068\n",
      "  0.00179355 0.00179355 0.00335068 0.00451553 0.00335068 0.00335068\n",
      "  0.00179355 0.00179355 0.00179355 0.00179355 0.00335068 0.00179355\n",
      "  0.00179355 0.00179355 0.00179355 0.00179355 0.00451553 0.00179355\n",
      "  0.00179355 0.00179355 0.00179355 0.00451553 0.00451553 0.00179355\n",
      "  0.00179355 0.00179355 0.00335068 0.00843582 0.00179355 0.00451553\n",
      "  0.00335068 0.00451553 0.00843582 0.00451553 0.00179355 0.00843582\n",
      "  0.00843582 0.00179355 0.00179355 0.00179355 0.00179355 0.00179355\n",
      "  0.00335068 0.00843582 0.00179355 0.00335068 0.00179355 0.00335068\n",
      "  0.00179355 0.00179355 0.00179355 0.00451553 0.00179355 0.00179355\n",
      "  0.00179355 0.00451553 0.00179355 0.00179355 0.00179355 0.00179355\n",
      "  0.00179355 0.00179355 0.00179355 0.00843582 0.00335068 0.00179355\n",
      "  0.00179355 0.00335068 0.00179355 0.00179355 0.00179355 0.00451553\n",
      "  0.00335068 0.00451553 0.00179355 0.00451553 0.00843582 0.00843582\n",
      "  0.00451553 0.00451553 0.00335068 0.00843582 0.00451553 0.00179355\n",
      "  0.00451553 0.00451553 0.00179355 0.00179355 0.00335068 0.00179355\n",
      "  0.00843582 0.00179355 0.00179355 0.00179355 0.00179355 0.00843582\n",
      "  0.00451553 0.00451553 0.00179355 0.00843582 0.00335068 0.00335068\n",
      "  0.00179355 0.00179355 0.00179355 0.00179355 0.00451553 0.00451553\n",
      "  0.00179355 0.00179355 0.00179355 0.00335068 0.00179355 0.00179355\n",
      "  0.00179355 0.00179355 0.00451553 0.00335068 0.00843582 0.00179355\n",
      "  0.00451553 0.00335068 0.00179355 0.00179355 0.00843582]]\n",
      "classEst:  [[-1. -1.  1. -1. -1.  1.  1. -1. -1. -1. -1. -1.  1. -1. -1. -1. -1.  1.\n",
      "  -1. -1. -1.  1.  1. -1. -1. -1. -1.  1.  1.  1. -1. -1. -1. -1. -1. -1.\n",
      "  -1. -1.  1. -1. -1. -1. -1. -1. -1. -1. -1.  1. -1. -1.  1. -1.  1.  1.\n",
      "  -1. -1.  1. -1.  1. -1.  1. -1. -1. -1. -1. -1. -1.  1.  1.  1. -1.  1.\n",
      "  -1.  1.  1. -1.  1.  1.  1. -1. -1.  1. -1.  1. -1.  1. -1.  1. -1.  1.\n",
      "   1. -1.  1.  1.  1.  1. -1. -1.  1. -1.  1. -1.  1. -1.  1. -1.  1.  1.\n",
      "  -1. -1. -1.  1.  1. -1.  1.  1.  1.  1. -1. -1.  1. -1.  1. -1.  1.  1.\n",
      "   1.  1. -1.  1.  1. -1.  1. -1. -1.  1.  1. -1. -1.  1.  1. -1.  1. -1.\n",
      "  -1.  1.  1. -1.  1.  1.  1. -1.  1.  1.  1.  1. -1.  1.  1.  1.  1. -1.\n",
      "  -1. -1. -1.  1.  1. -1. -1.  1. -1. -1. -1.  1.  1. -1. -1. -1. -1. -1.\n",
      "   1.  1. -1. -1. -1. -1. -1. -1. -1.  1. -1.  1. -1. -1.  1. -1. -1. -1.\n",
      "  -1.  1. -1.  1.  1.  1. -1. -1.  1. -1.  1. -1. -1. -1.  1. -1.  1.  1.\n",
      "  -1.  1.  1. -1. -1. -1. -1.  1.  1. -1.  1. -1. -1. -1. -1.  1. -1.  1.\n",
      "   1.  1.  1. -1. -1. -1.  1.  1. -1. -1. -1. -1. -1. -1.  1. -1.  1. -1.\n",
      "  -1. -1. -1. -1. -1.  1. -1.  1.  1. -1. -1.  1. -1. -1.  1.  1. -1. -1.\n",
      "  -1. -1. -1. -1. -1.  1.  1.  1. -1.  1. -1. -1. -1.  1. -1. -1. -1.  1.\n",
      "   1.  1. -1. -1. -1.  1. -1. -1. -1. -1.  1.]]\n",
      "aggClassEst:  [[-0.43598966  0.4873351   1.06095456  0.4873351  -0.1376298   1.06095456\n",
      "   1.06095456  0.4873351  -0.43598966 -0.43598966  0.4873351   0.4873351\n",
      "   1.06095456  0.4873351   0.4873351  -0.43598966 -1.06095456  1.06095456\n",
      "   0.4873351  -0.1376298  -0.43598966  1.06095456  1.06095456  0.4873351\n",
      "   0.4873351   0.4873351   0.4873351   1.06095456  1.06095456  1.06095456\n",
      "  -1.06095456  0.4873351   0.4873351   0.4873351  -0.43598966 -1.06095456\n",
      "   0.4873351  -1.06095456  1.06095456  0.4873351  -1.06095456  0.4873351\n",
      "   0.4873351  -0.43598966 -1.06095456 -1.06095456 -1.06095456  1.06095456\n",
      "  -0.1376298  -1.06095456  1.06095456  0.4873351   1.06095456  1.06095456\n",
      "  -0.1376298   0.4873351   1.06095456 -0.43598966 -0.4873351  -1.06095456\n",
      "   1.06095456  0.4873351  -0.1376298  -0.1376298   0.4873351   0.4873351\n",
      "  -0.1376298   1.06095456  0.43598966  1.06095456  0.4873351   1.06095456\n",
      "   0.4873351  -0.4873351   1.06095456  0.4873351   1.06095456  1.06095456\n",
      "   0.1376298  -0.1376298  -0.43598966  1.06095456  0.4873351  -0.4873351\n",
      "   0.4873351   1.06095456 -0.43598966  1.06095456  0.4873351   1.06095456\n",
      "   0.43598966 -0.1376298   1.06095456  0.1376298   1.06095456  1.06095456\n",
      "   0.4873351  -0.1376298   1.06095456 -0.1376298   1.06095456 -0.43598966\n",
      "   1.06095456  0.4873351   0.1376298   0.4873351   1.06095456  1.06095456\n",
      "  -1.06095456  0.4873351  -0.1376298   1.06095456  1.06095456  0.4873351\n",
      "   0.1376298   1.06095456  1.06095456  1.06095456 -0.43598966  0.4873351\n",
      "   1.06095456 -1.06095456  1.06095456 -0.43598966  1.06095456  1.06095456\n",
      "   0.1376298   0.1376298   0.4873351   1.06095456  1.06095456  0.4873351\n",
      "   1.06095456 -1.06095456 -0.43598966  0.1376298   1.06095456  0.4873351\n",
      "   0.4873351   1.06095456  0.43598966 -1.06095456  1.06095456 -0.1376298\n",
      "   0.4873351   1.06095456  1.06095456 -0.1376298   1.06095456  1.06095456\n",
      "  -0.4873351  -0.1376298   1.06095456  1.06095456  1.06095456  1.06095456\n",
      "   0.4873351   1.06095456  1.06095456  0.1376298   1.06095456  0.4873351\n",
      "  -0.43598966  0.4873351  -0.1376298   1.06095456  1.06095456 -0.1376298\n",
      "  -0.43598966  1.06095456 -0.1376298  -0.1376298  -0.1376298   0.1376298\n",
      "   1.06095456  0.4873351  -0.43598966 -0.43598966 -0.43598966 -0.43598966\n",
      "   1.06095456 -0.4873351   0.4873351   0.4873351  -0.1376298   0.4873351\n",
      "   0.4873351   0.4873351   0.4873351   1.06095456 -0.43598966  1.06095456\n",
      "  -1.06095456  0.4873351   1.06095456 -0.1376298  -0.1376298   0.4873351\n",
      "   0.4873351   1.06095456 -0.43598966  1.06095456  1.06095456  0.1376298\n",
      "  -0.43598966 -0.43598966  1.06095456 -0.1376298   1.06095456  0.4873351\n",
      "   0.4873351   0.4873351   1.06095456  0.4873351   1.06095456  1.06095456\n",
      "  -0.1376298   1.06095456  1.06095456 -0.43598966  0.4873351  -0.1376298\n",
      "   0.4873351   1.06095456  1.06095456 -0.1376298   1.06095456 -1.06095456\n",
      "   0.4873351  -0.43598966 -1.06095456  1.06095456  0.4873351   1.06095456\n",
      "  -0.4873351   1.06095456  1.06095456  0.4873351  -0.43598966 -1.06095456\n",
      "   1.06095456  0.1376298   0.4873351   0.4873351  -1.06095456 -0.43598966\n",
      "  -0.43598966 -0.43598966  1.06095456 -0.1376298   1.06095456  0.4873351\n",
      "  -0.43598966 -0.43598966 -0.43598966  0.4873351  -0.1376298   1.06095456\n",
      "  -0.1376298   0.1376298   1.06095456  0.4873351  -0.43598966  1.06095456\n",
      "   0.4873351   0.4873351   1.06095456  1.06095456  0.4873351   0.4873351\n",
      "  -0.43598966 -0.43598966 -1.06095456  0.4873351  -0.43598966  0.1376298\n",
      "   1.06095456  1.06095456  0.4873351   1.06095456 -0.1376298  -0.1376298\n",
      "   0.4873351   1.06095456  0.4873351  -0.43598966  0.4873351   1.06095456\n",
      "   1.06095456  1.06095456 -0.1376298  -0.43598966  0.4873351   1.06095456\n",
      "  -0.1376298  -0.43598966 -1.06095456  0.4873351   1.06095456]]\n",
      "total error:  0.24749163879598662 \n",
      "\n",
      "D:  [[0.00261936 0.00659463 0.00140209 0.00659463 0.00352998 0.00140209\n",
      "  0.00140209 0.00659463 0.00261936 0.00626457 0.00248826 0.00248826\n",
      "  0.00140209 0.00659463 0.00248826 0.00261936 0.00140209 0.00140209\n",
      "  0.00248826 0.00464853 0.00626457 0.00140209 0.00140209 0.00248826\n",
      "  0.00248826 0.00248826 0.00248826 0.00140209 0.01170335 0.00140209\n",
      "  0.00140209 0.00659463 0.00248826 0.00248826 0.00626457 0.00140209\n",
      "  0.00659463 0.01170335 0.00140209 0.00659463 0.00140209 0.00248826\n",
      "  0.00248826 0.00261936 0.00140209 0.00140209 0.01170335 0.00140209\n",
      "  0.00352998 0.00140209 0.00140209 0.00659463 0.00140209 0.00140209\n",
      "  0.00352998 0.00659463 0.00140209 0.00261936 0.00248826 0.00140209\n",
      "  0.00140209 0.00248826 0.00352998 0.00352998 0.00248826 0.00248826\n",
      "  0.00464853 0.00140209 0.00261936 0.00140209 0.00659463 0.00140209\n",
      "  0.00659463 0.00248826 0.01170335 0.00659463 0.00140209 0.00140209\n",
      "  0.00464853 0.00464853 0.00261936 0.00140209 0.00248826 0.00248826\n",
      "  0.00248826 0.00140209 0.00261936 0.01170335 0.00248826 0.00140209\n",
      "  0.00261936 0.00352998 0.00140209 0.00464853 0.00140209 0.00140209\n",
      "  0.00248826 0.00352998 0.00140209 0.00464853 0.00140209 0.00261936\n",
      "  0.00140209 0.00248826 0.00464853 0.00248826 0.00140209 0.00140209\n",
      "  0.00140209 0.00659463 0.00352998 0.00140209 0.00140209 0.00659463\n",
      "  0.00352998 0.00140209 0.00140209 0.01170335 0.00626457 0.00248826\n",
      "  0.00140209 0.00140209 0.00140209 0.00261936 0.01170335 0.00140209\n",
      "  0.00352998 0.00352998 0.00659463 0.00140209 0.01170335 0.00659463\n",
      "  0.00140209 0.00140209 0.00261936 0.00464853 0.00140209 0.00248826\n",
      "  0.00248826 0.00140209 0.00626457 0.00140209 0.00140209 0.00352998\n",
      "  0.00248826 0.00140209 0.01170335 0.00464853 0.00140209 0.00140209\n",
      "  0.00248826 0.00464853 0.00140209 0.00140209 0.00140209 0.00140209\n",
      "  0.00659463 0.00140209 0.00140209 0.00352998 0.01170335 0.00248826\n",
      "  0.00261936 0.00248826 0.00352998 0.00140209 0.00140209 0.00464853\n",
      "  0.00261936 0.00140209 0.00352998 0.00464853 0.00352998 0.00464853\n",
      "  0.00140209 0.00248826 0.00261936 0.00626457 0.00261936 0.00261936\n",
      "  0.00140209 0.00248826 0.00248826 0.00248826 0.00464853 0.00248826\n",
      "  0.00248826 0.00248826 0.00248826 0.00140209 0.00626457 0.00140209\n",
      "  0.00140209 0.00248826 0.00140209 0.00352998 0.00352998 0.00248826\n",
      "  0.00248826 0.00140209 0.00261936 0.01170335 0.00140209 0.00352998\n",
      "  0.00261936 0.00626457 0.01170335 0.00352998 0.00140209 0.00659463\n",
      "  0.00659463 0.00248826 0.00140209 0.00248826 0.00140209 0.00140209\n",
      "  0.00464853 0.01170335 0.00140209 0.00261936 0.00248826 0.00464853\n",
      "  0.00248826 0.00140209 0.00140209 0.00352998 0.00140209 0.00140209\n",
      "  0.00248826 0.00626457 0.00140209 0.00140209 0.00248826 0.00140209\n",
      "  0.00248826 0.00140209 0.00140209 0.00659463 0.00261936 0.00140209\n",
      "  0.00140209 0.00464853 0.00248826 0.00248826 0.00140209 0.00626457\n",
      "  0.00261936 0.00626457 0.00140209 0.00352998 0.01170335 0.00659463\n",
      "  0.00626457 0.00626457 0.00261936 0.00659463 0.00352998 0.00140209\n",
      "  0.00352998 0.00352998 0.00140209 0.00248826 0.00261936 0.00140209\n",
      "  0.00659463 0.00248826 0.00140209 0.00140209 0.00248826 0.00659463\n",
      "  0.00626457 0.00626457 0.00140209 0.00659463 0.00261936 0.00464853\n",
      "  0.00140209 0.00140209 0.00248826 0.00140209 0.00352998 0.00352998\n",
      "  0.00248826 0.00140209 0.00248826 0.00261936 0.00248826 0.00140209\n",
      "  0.00140209 0.00140209 0.00352998 0.00261936 0.00659463 0.00140209\n",
      "  0.00352998 0.00261936 0.00140209 0.00248826 0.01170335]]\n",
      "classEst:  [[-1.  1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1.  1. -1. -1. -1.\n",
      "  -1. -1. -1. -1. -1.  1.  1. -1. -1. -1. -1.  1. -1. -1. -1. -1. -1. -1.\n",
      "  -1.  1. -1. -1. -1. -1. -1.  1.  1. -1. -1. -1. -1. -1. -1. -1. -1. -1.\n",
      "  -1. -1. -1. -1. -1. -1. -1. -1. -1.  1. -1.  1.  1. -1. -1. -1. -1. -1.\n",
      "  -1. -1. -1. -1.  1.  1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1.\n",
      "   1. -1. -1. -1. -1.  1. -1. -1. -1. -1.  1. -1. -1. -1. -1. -1. -1. -1.\n",
      "   1. -1. -1. -1. -1. -1.  1.  1.  1. -1.  1.  1. -1. -1. -1. -1. -1. -1.\n",
      "  -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1.  1. -1. -1. -1. -1. -1.  1.\n",
      "   1.  1. -1. -1.  1.  1. -1.  1. -1.  1. -1. -1.  1. -1. -1. -1. -1. -1.\n",
      "  -1. -1.  1. -1. -1. -1. -1. -1. -1.  1. -1. -1. -1.  1. -1.  1. -1. -1.\n",
      "  -1. -1.  1.  1. -1. -1. -1. -1. -1. -1. -1.  1. -1. -1.  1. -1. -1.  1.\n",
      "  -1. -1. -1. -1. -1. -1. -1.  1. -1.  1. -1. -1. -1. -1. -1. -1. -1. -1.\n",
      "  -1. -1. -1. -1.  1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1.\n",
      "  -1. -1. -1. -1.  1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1.\n",
      "  -1.  1. -1.  1. -1. -1. -1.  1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1.\n",
      "  -1. -1. -1. -1. -1.  1. -1. -1. -1.  1. -1. -1. -1. -1. -1. -1. -1. -1.\n",
      "  -1. -1. -1. -1. -1.  1.  1. -1. -1. -1. -1.]]\n",
      "aggClassEst:  [[-0.66895971  0.72030514  0.82798452  0.25436505 -0.37059985  0.82798452\n",
      "   0.82798452  0.25436505 -0.66895971 -0.66895971  0.25436505  0.25436505\n",
      "   0.82798452  0.25436505  0.72030514 -0.66895971 -1.29392461  0.82798452\n",
      "   0.25436505 -0.37059985 -0.66895971  0.82798452  0.82798452  0.72030514\n",
      "   0.72030514  0.25436505  0.25436505  0.82798452  0.82798452  1.29392461\n",
      "  -1.29392461  0.25436505  0.25436505  0.25436505 -0.66895971 -1.29392461\n",
      "   0.25436505 -0.82798452  0.82798452  0.25436505 -1.29392461  0.25436505\n",
      "   0.25436505 -0.20301961 -0.82798452 -1.29392461 -1.29392461  0.82798452\n",
      "  -0.37059985 -1.29392461  0.82798452  0.25436505  0.82798452  0.82798452\n",
      "  -0.37059985  0.25436505  0.82798452 -0.66895971 -0.72030514 -1.29392461\n",
      "   0.82798452  0.25436505 -0.37059985  0.09534024  0.25436505  0.72030514\n",
      "   0.09534024  0.82798452  0.20301961  0.82798452  0.25436505  0.82798452\n",
      "   0.25436505 -0.72030514  0.82798452  0.25436505  1.29392461  1.29392461\n",
      "  -0.09534024 -0.37059985 -0.66895971  0.82798452  0.25436505 -0.72030514\n",
      "   0.25436505  0.82798452 -0.66895971  0.82798452  0.25436505  0.82798452\n",
      "   0.66895971 -0.37059985  0.82798452 -0.09534024  0.82798452  1.29392461\n",
      "   0.25436505 -0.37059985  0.82798452 -0.37059985  1.29392461 -0.66895971\n",
      "   0.82798452  0.25436505 -0.09534024  0.25436505  0.82798452  0.82798452\n",
      "  -0.82798452  0.25436505 -0.37059985  0.82798452  0.82798452  0.25436505\n",
      "   0.37059985  1.29392461  1.29392461  0.82798452 -0.20301961  0.72030514\n",
      "   0.82798452 -1.29392461  0.82798452 -0.66895971  0.82798452  0.82798452\n",
      "  -0.09534024 -0.09534024  0.25436505  0.82798452  0.82798452  0.25436505\n",
      "   0.82798452 -1.29392461 -0.66895971 -0.09534024  0.82798452  0.72030514\n",
      "   0.25436505  0.82798452  0.20301961 -1.29392461  0.82798452  0.09534024\n",
      "   0.72030514  1.29392461  0.82798452 -0.37059985  1.29392461  1.29392461\n",
      "  -0.72030514  0.09534024  0.82798452  1.29392461  0.82798452  0.82798452\n",
      "   0.72030514  0.82798452  0.82798452 -0.09534024  0.82798452  0.25436505\n",
      "  -0.66895971  0.25436505  0.09534024  0.82798452  0.82798452 -0.37059985\n",
      "  -0.66895971  0.82798452 -0.37059985  0.09534024 -0.37059985 -0.09534024\n",
      "   0.82798452  0.72030514 -0.66895971 -0.20301961 -0.66895971 -0.66895971\n",
      "   0.82798452 -0.72030514  0.72030514  0.72030514 -0.37059985  0.25436505\n",
      "   0.25436505  0.25436505  0.25436505  0.82798452 -0.66895971  1.29392461\n",
      "  -1.29392461  0.25436505  1.29392461 -0.37059985 -0.37059985  0.72030514\n",
      "   0.25436505  0.82798452 -0.66895971  0.82798452  0.82798452 -0.09534024\n",
      "  -0.66895971 -0.20301961  0.82798452  0.09534024  0.82798452  0.25436505\n",
      "   0.25436505  0.25436505  0.82798452  0.25436505  0.82798452  0.82798452\n",
      "  -0.37059985  0.82798452  0.82798452 -0.66895971  0.72030514 -0.37059985\n",
      "   0.25436505  0.82798452  0.82798452 -0.37059985  0.82798452 -1.29392461\n",
      "   0.25436505 -0.66895971 -1.29392461  0.82798452  0.25436505  0.82798452\n",
      "  -0.72030514  0.82798452  0.82798452  0.25436505 -0.20301961 -1.29392461\n",
      "   0.82798452 -0.09534024  0.25436505  0.25436505 -1.29392461 -0.66895971\n",
      "  -0.66895971 -0.66895971  0.82798452 -0.37059985  0.82798452  0.25436505\n",
      "  -0.66895971 -0.20301961 -0.66895971  0.72030514 -0.37059985  0.82798452\n",
      "  -0.37059985  0.37059985  0.82798452  0.25436505 -0.66895971  0.82798452\n",
      "   0.25436505  0.25436505  0.82798452  0.82798452  0.25436505  0.25436505\n",
      "  -0.66895971 -0.66895971 -1.29392461  0.25436505 -0.66895971  0.37059985\n",
      "   0.82798452  0.82798452  0.25436505  1.29392461 -0.37059985 -0.37059985\n",
      "   0.25436505  0.82798452  0.25436505 -0.66895971  0.25436505  0.82798452\n",
      "   0.82798452  0.82798452 -0.37059985 -0.66895971  0.25436505  1.29392461\n",
      "   0.09534024 -0.66895971 -1.29392461  0.25436505  0.82798452]]\n",
      "total error:  0.24749163879598662 \n",
      "\n",
      "D:  [[0.00213157 0.00855163 0.00181817 0.00536653 0.0028726  0.00181817\n",
      "  0.00181817 0.00536653 0.00213157 0.00812362 0.00322667 0.00322667\n",
      "  0.00181817 0.00536653 0.00202488 0.00213157 0.00114098 0.00181817\n",
      "  0.00322667 0.00602801 0.00812362 0.00181817 0.00181817 0.00202488\n",
      "  0.00202488 0.00322667 0.00322667 0.00181817 0.00952387 0.00114098\n",
      "  0.00114098 0.00536653 0.00322667 0.00322667 0.00812362 0.00114098\n",
      "  0.00536653 0.00952387 0.00181817 0.00536653 0.00114098 0.00322667\n",
      "  0.00322667 0.00339667 0.00181817 0.00114098 0.01517639 0.00181817\n",
      "  0.0028726  0.00114098 0.00181817 0.00536653 0.00181817 0.00181817\n",
      "  0.0028726  0.00536653 0.00181817 0.00213157 0.00202488 0.00114098\n",
      "  0.00181817 0.00322667 0.0028726  0.00457752 0.00322667 0.00202488\n",
      "  0.00378284 0.00181817 0.00339667 0.00181817 0.00536653 0.00181817\n",
      "  0.00536653 0.00202488 0.00952387 0.00536653 0.00114098 0.00114098\n",
      "  0.00378284 0.00602801 0.00213157 0.00181817 0.00322667 0.00202488\n",
      "  0.00322667 0.00181817 0.00213157 0.00952387 0.00322667 0.00181817\n",
      "  0.00213157 0.0028726  0.00181817 0.00378284 0.00181817 0.00114098\n",
      "  0.00322667 0.0028726  0.00181817 0.00602801 0.00114098 0.00213157\n",
      "  0.00181817 0.00322667 0.00378284 0.00322667 0.00181817 0.00181817\n",
      "  0.00181817 0.00536653 0.0028726  0.00181817 0.00181817 0.00536653\n",
      "  0.0028726  0.00114098 0.00114098 0.00952387 0.00509794 0.00202488\n",
      "  0.00181817 0.00114098 0.00181817 0.00213157 0.00952387 0.00181817\n",
      "  0.00457752 0.00457752 0.00536653 0.00181817 0.00952387 0.00536653\n",
      "  0.00181817 0.00114098 0.00213157 0.00378284 0.00181817 0.00202488\n",
      "  0.00322667 0.00181817 0.00509794 0.00114098 0.00181817 0.00457752\n",
      "  0.00202488 0.00114098 0.00952387 0.00602801 0.00114098 0.00114098\n",
      "  0.00202488 0.00378284 0.00181817 0.00114098 0.00181817 0.00181817\n",
      "  0.00855163 0.00181817 0.00181817 0.00457752 0.00952387 0.00322667\n",
      "  0.00213157 0.00322667 0.00457752 0.00181817 0.00181817 0.00602801\n",
      "  0.00213157 0.00181817 0.0028726  0.00378284 0.0028726  0.00378284\n",
      "  0.00181817 0.00202488 0.00213157 0.00509794 0.00213157 0.00213157\n",
      "  0.00181817 0.00202488 0.00202488 0.00202488 0.00602801 0.00322667\n",
      "  0.00322667 0.00322667 0.00322667 0.00181817 0.00812362 0.00114098\n",
      "  0.00114098 0.00322667 0.00114098 0.0028726  0.0028726  0.00202488\n",
      "  0.00322667 0.00181817 0.00213157 0.00952387 0.00181817 0.00457752\n",
      "  0.00213157 0.00509794 0.00952387 0.00457752 0.00181817 0.00536653\n",
      "  0.00536653 0.00322667 0.00181817 0.00322667 0.00181817 0.00181817\n",
      "  0.00602801 0.00952387 0.00181817 0.00213157 0.00202488 0.00602801\n",
      "  0.00322667 0.00181817 0.00181817 0.0028726  0.00181817 0.00114098\n",
      "  0.00322667 0.00812362 0.00114098 0.00181817 0.00322667 0.00181817\n",
      "  0.00202488 0.00181817 0.00181817 0.00536653 0.00339667 0.00114098\n",
      "  0.00181817 0.00378284 0.00322667 0.00322667 0.00114098 0.00812362\n",
      "  0.00213157 0.00812362 0.00181817 0.0028726  0.00952387 0.00536653\n",
      "  0.00812362 0.00509794 0.00213157 0.00855163 0.0028726  0.00181817\n",
      "  0.0028726  0.0028726  0.00181817 0.00322667 0.00213157 0.00181817\n",
      "  0.00536653 0.00322667 0.00181817 0.00181817 0.00322667 0.00536653\n",
      "  0.00812362 0.00812362 0.00114098 0.00536653 0.00213157 0.00602801\n",
      "  0.00181817 0.00181817 0.00322667 0.00114098 0.0028726  0.0028726\n",
      "  0.00322667 0.00181817 0.00322667 0.00213157 0.00322667 0.00181817\n",
      "  0.00181817 0.00181817 0.0028726  0.00213157 0.00536653 0.00114098\n",
      "  0.00457752 0.00213157 0.00114098 0.00322667 0.00952387]]\n",
      "classEst:  [[ 1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.\n",
      "   1.  1.  1.  1.  1.  1.  1. -1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.\n",
      "  -1.  1.  1. -1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.\n",
      "   1.  1. -1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1. -1.  1. -1.  1.\n",
      "  -1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1. -1.  1.  1.\n",
      "  -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1. -1.  1.\n",
      "   1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1.  1. -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.\n",
      "   1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1. -1.  1.\n",
      "   1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1. -1. -1.  1. -1.  1.  1.  1.\n",
      "  -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1.  1. -1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1. -1.\n",
      "  -1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1. -1.  1.  1.\n",
      "   1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1.  1.  1.  1.  1.  1.  1. -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1. -1. -1. -1.\n",
      "   1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.]]\n",
      "aggClassEst:  [[-0.47092125  0.91834361  1.02602298  0.45240351 -0.56863831  1.02602298\n",
      "   1.02602298  0.45240351 -0.47092125 -0.47092125  0.45240351  0.45240351\n",
      "   1.02602298  0.45240351  0.91834361 -0.47092125 -1.09588615  0.62994605\n",
      "   0.45240351 -0.17256139 -0.47092125  1.02602298  1.02602298  0.91834361\n",
      "   0.91834361  0.05632659  0.45240351  1.02602298  0.62994605  1.49196307\n",
      "  -1.09588615  0.45240351  0.45240351  0.45240351 -0.47092125 -1.09588615\n",
      "   0.05632659 -0.62994605  1.02602298  0.05632659 -1.09588615  0.05632659\n",
      "   0.45240351 -0.00498115 -0.62994605 -1.09588615 -1.09588615  1.02602298\n",
      "  -0.17256139 -1.09588615  1.02602298  0.45240351  1.02602298  0.62994605\n",
      "  -0.17256139  0.45240351  0.62994605 -0.47092125 -0.52226668 -1.09588615\n",
      "   1.02602298  0.45240351 -0.56863831  0.2933787   0.45240351  0.91834361\n",
      "   0.2933787   1.02602298  0.00498115  1.02602298  0.05632659  1.02602298\n",
      "   0.05632659 -0.52226668  0.62994605  0.45240351  1.49196307  1.49196307\n",
      "   0.10269822 -0.17256139 -0.47092125  1.02602298  0.45240351 -0.91834361\n",
      "   0.45240351  1.02602298 -0.47092125  0.62994605  0.45240351  1.02602298\n",
      "   0.47092125 -0.17256139  1.02602298  0.10269822  1.02602298  1.49196307\n",
      "   0.45240351 -0.17256139  1.02602298 -0.17256139  1.49196307 -0.47092125\n",
      "   0.62994605  0.45240351  0.10269822  0.45240351  0.62994605  1.02602298\n",
      "  -0.62994605  0.45240351 -0.17256139  1.02602298  1.02602298  0.05632659\n",
      "   0.56863831  1.49196307  1.49196307  1.02602298 -0.00498115  0.91834361\n",
      "   1.02602298 -1.09588615  1.02602298 -0.47092125  1.02602298  1.02602298\n",
      "   0.10269822  0.10269822  0.45240351  0.62994605  0.62994605  0.45240351\n",
      "   1.02602298 -1.09588615 -0.47092125  0.10269822  1.02602298  0.91834361\n",
      "   0.45240351  1.02602298  0.00498115 -1.09588615  1.02602298  0.2933787\n",
      "   0.91834361  1.49196307  1.02602298 -0.17256139  1.49196307  1.49196307\n",
      "  -0.52226668  0.2933787   1.02602298  1.49196307  1.02602298  1.02602298\n",
      "   0.91834361  1.02602298  1.02602298 -0.2933787   0.62994605  0.45240351\n",
      "  -0.47092125  0.45240351  0.2933787   1.02602298  1.02602298 -0.17256139\n",
      "  -0.86699817  1.02602298 -0.17256139  0.2933787  -0.17256139 -0.2933787\n",
      "   0.62994605  0.91834361 -0.86699817 -0.00498115 -0.47092125 -0.47092125\n",
      "   0.62994605 -0.91834361  0.91834361  0.91834361 -0.17256139  0.45240351\n",
      "   0.45240351  0.45240351  0.45240351  1.02602298 -0.47092125  1.49196307\n",
      "  -1.09588615  0.45240351  1.49196307 -0.17256139 -0.17256139  0.91834361\n",
      "   0.45240351  1.02602298 -0.47092125  0.62994605  1.02602298  0.10269822\n",
      "  -0.47092125 -0.00498115  0.62994605  0.2933787   1.02602298  0.45240351\n",
      "   0.45240351  0.45240351  1.02602298  0.45240351  1.02602298  0.62994605\n",
      "  -0.56863831  1.02602298  1.02602298 -0.47092125  0.91834361 -0.17256139\n",
      "   0.45240351  1.02602298  1.02602298 -0.17256139  0.62994605 -1.09588615\n",
      "   0.45240351 -0.47092125 -1.09588615  0.62994605  0.45240351  1.02602298\n",
      "  -0.52226668  1.02602298  1.02602298  0.45240351 -0.00498115 -1.09588615\n",
      "   1.02602298  0.10269822  0.45240351  0.45240351 -1.09588615 -0.47092125\n",
      "  -0.47092125 -0.47092125  1.02602298 -0.17256139  1.02602298  0.45240351\n",
      "  -0.47092125 -0.00498115 -0.47092125  0.91834361 -0.17256139  1.02602298\n",
      "  -0.17256139  0.56863831  0.62994605  0.05632659 -0.47092125  1.02602298\n",
      "   0.45240351  0.45240351  1.02602298  1.02602298  0.45240351  0.45240351\n",
      "  -0.47092125 -0.47092125 -1.09588615  0.45240351 -0.47092125  0.56863831\n",
      "   1.02602298  1.02602298  0.45240351  1.49196307 -0.17256139 -0.17256139\n",
      "   0.05632659  1.02602298  0.45240351 -0.86699817  0.05632659  0.62994605\n",
      "   1.02602298  1.02602298 -0.17256139 -0.47092125  0.45240351  1.49196307\n",
      "   0.2933787  -0.47092125 -1.09588615  0.45240351  0.62994605]]\n",
      "total error:  0.25418060200668896 \n",
      "\n",
      "D:  [[0.00264952 0.0106296  0.00152086 0.00667055 0.00240286 0.00152086\n",
      "  0.00152086 0.00667055 0.00264952 0.00679523 0.00269904 0.00269904\n",
      "  0.00152086 0.00667055 0.00169377 0.00264952 0.00141823 0.00225997\n",
      "  0.00269904 0.00504229 0.00679523 0.00152086 0.00152086 0.00169377\n",
      "  0.00169377 0.00401073 0.00269904 0.00152086 0.0079665  0.00095441\n",
      "  0.00141823 0.00667055 0.00269904 0.00269904 0.00679523 0.00141823\n",
      "  0.00448898 0.0079665  0.00152086 0.00448898 0.00141823 0.00401073\n",
      "  0.00269904 0.00422204 0.00225997 0.00141823 0.01269471 0.00152086\n",
      "  0.00357061 0.00141823 0.00152086 0.00667055 0.00152086 0.00225997\n",
      "  0.00357061 0.00667055 0.00225997 0.00264952 0.00251691 0.00141823\n",
      "  0.00152086 0.00269904 0.00240286 0.00568982 0.00269904 0.00169377\n",
      "  0.00316426 0.00152086 0.00422204 0.00152086 0.00448898 0.00152086\n",
      "  0.00448898 0.00251691 0.0079665  0.00667055 0.00095441 0.00095441\n",
      "  0.00470204 0.00504229 0.00264952 0.00152086 0.00269904 0.00169377\n",
      "  0.00269904 0.00152086 0.00264952 0.0079665  0.00269904 0.00152086\n",
      "  0.00264952 0.00357061 0.00152086 0.00470204 0.00152086 0.00095441\n",
      "  0.00269904 0.00357061 0.00152086 0.00504229 0.00095441 0.00264952\n",
      "  0.00225997 0.00269904 0.00470204 0.00269904 0.00225997 0.00152086\n",
      "  0.00225997 0.00667055 0.00357061 0.00152086 0.00152086 0.00448898\n",
      "  0.00240286 0.00095441 0.00095441 0.01183809 0.00426431 0.00169377\n",
      "  0.00152086 0.00141823 0.00152086 0.00264952 0.01183809 0.00152086\n",
      "  0.00382899 0.00382899 0.00667055 0.00225997 0.0079665  0.00667055\n",
      "  0.00152086 0.00141823 0.00264952 0.00470204 0.00152086 0.00169377\n",
      "  0.00269904 0.00152086 0.00426431 0.00141823 0.00152086 0.00568982\n",
      "  0.00169377 0.00095441 0.01183809 0.00504229 0.00095441 0.00095441\n",
      "  0.00251691 0.00316426 0.00152086 0.00095441 0.00152086 0.00152086\n",
      "  0.0106296  0.00152086 0.00152086 0.00568982 0.0079665  0.00269904\n",
      "  0.00264952 0.00269904 0.00568982 0.00152086 0.00152086 0.00504229\n",
      "  0.00178301 0.00152086 0.00357061 0.00316426 0.00357061 0.00316426\n",
      "  0.00225997 0.00169377 0.00178301 0.00426431 0.00264952 0.00264952\n",
      "  0.00225997 0.00169377 0.00169377 0.00169377 0.00504229 0.00269904\n",
      "  0.00269904 0.00269904 0.00269904 0.00152086 0.00679523 0.00095441\n",
      "  0.00141823 0.00269904 0.00095441 0.00357061 0.00357061 0.00169377\n",
      "  0.00269904 0.00152086 0.00264952 0.0079665  0.00152086 0.00382899\n",
      "  0.00264952 0.00426431 0.0079665  0.00568982 0.00152086 0.00667055\n",
      "  0.00667055 0.00269904 0.00152086 0.00269904 0.00152086 0.00225997\n",
      "  0.00749276 0.01183809 0.00152086 0.00264952 0.00169377 0.00504229\n",
      "  0.00269904 0.00152086 0.00152086 0.00357061 0.00225997 0.00141823\n",
      "  0.00269904 0.00679523 0.00141823 0.00225997 0.00269904 0.00152086\n",
      "  0.00251691 0.00152086 0.00152086 0.00667055 0.00422204 0.00141823\n",
      "  0.00152086 0.00470204 0.00269904 0.00269904 0.00141823 0.00679523\n",
      "  0.00264952 0.00679523 0.00152086 0.00357061 0.01183809 0.00667055\n",
      "  0.00679523 0.00426431 0.00264952 0.0106296  0.00357061 0.00152086\n",
      "  0.00357061 0.00240286 0.00225997 0.00401073 0.00264952 0.00152086\n",
      "  0.00667055 0.00269904 0.00152086 0.00152086 0.00269904 0.00667055\n",
      "  0.00679523 0.00679523 0.00141823 0.00667055 0.00264952 0.00749276\n",
      "  0.00152086 0.00152086 0.00269904 0.00095441 0.00357061 0.00357061\n",
      "  0.00401073 0.00152086 0.00269904 0.00178301 0.00401073 0.00225997\n",
      "  0.00152086 0.00152086 0.00357061 0.00264952 0.00667055 0.00095441\n",
      "  0.00568982 0.00264952 0.00141823 0.00269904 0.0079665 ]]\n",
      "classEst:  [[-1.  1.  1. -1.  1.  1.  1. -1. -1.  1. -1.  1.  1.  1. -1. -1. -1.  1.\n",
      "   1. -1.  1.  1.  1.  1. -1.  1. -1. -1.  1.  1. -1. -1.  1.  1. -1. -1.\n",
      "   1.  1.  1.  1. -1.  1. -1. -1. -1. -1. -1.  1. -1. -1.  1.  1.  1.  1.\n",
      "  -1. -1.  1.  1. -1. -1.  1.  1.  1. -1. -1. -1.  1.  1.  1.  1. -1.  1.\n",
      "   1.  1.  1. -1. -1.  1. -1.  1. -1.  1. -1. -1.  1.  1. -1.  1.  1.  1.\n",
      "   1. -1. -1. -1. -1.  1.  1. -1.  1. -1. -1. -1. -1.  1.  1.  1.  1.  1.\n",
      "  -1. -1. -1. -1.  1.  1. -1. -1.  1. -1.  1.  1.  1.  1.  1.  1. -1. -1.\n",
      "  -1. -1.  1.  1.  1. -1.  1. -1. -1. -1.  1.  1.  1. -1.  1. -1.  1. -1.\n",
      "  -1.  1.  1.  1.  1. -1. -1. -1. -1.  1. -1.  1.  1. -1.  1.  1.  1. -1.\n",
      "   1.  1.  1.  1.  1.  1.  1.  1. -1. -1. -1. -1.  1.  1.  1. -1. -1. -1.\n",
      "   1. -1.  1.  1. -1.  1. -1.  1. -1.  1.  1.  1. -1.  1. -1.  1. -1.  1.\n",
      "  -1.  1.  1.  1.  1. -1. -1.  1.  1. -1. -1.  1. -1.  1. -1.  1.  1.  1.\n",
      "   1.  1. -1. -1. -1. -1.  1.  1.  1. -1.  1. -1.  1. -1. -1.  1. -1. -1.\n",
      "   1.  1.  1. -1.  1. -1.  1.  1.  1.  1. -1. -1. -1.  1.  1. -1. -1. -1.\n",
      "  -1. -1.  1.  1. -1.  1. -1.  1.  1.  1.  1. -1. -1.  1. -1.  1.  1. -1.\n",
      "  -1. -1. -1.  1.  1. -1.  1.  1. -1.  1. -1. -1.  1.  1.  1. -1.  1.  1.\n",
      "   1.  1. -1.  1. -1.  1. -1. -1. -1. -1.  1.]]\n",
      "aggClassEst:  [[-0.65940012  1.10682248  1.21450185  0.26392464 -0.38015944  1.21450185\n",
      "   1.21450185  0.26392464 -0.65940012 -0.28244237  0.26392464  0.64088239\n",
      "   1.21450185  0.64088239  0.72986473 -0.65940012 -1.28436502  0.81842493\n",
      "   0.64088239 -0.36104026 -0.28244237  1.21450185  1.21450185  1.10682248\n",
      "   0.72986473  0.24480546  0.26392464  0.8375441   0.81842493  1.68044194\n",
      "  -1.28436502  0.26392464  0.64088239  0.64088239 -0.65940012 -1.28436502\n",
      "   0.24480546 -0.44146718  1.21450185  0.24480546 -1.28436502  0.24480546\n",
      "   0.26392464 -0.19346003 -0.81842493 -1.28436502 -1.28436502  1.21450185\n",
      "  -0.36104026 -1.28436502  1.21450185  0.64088239  1.21450185  0.81842493\n",
      "  -0.36104026  0.26392464  0.81842493 -0.28244237 -0.71074556 -1.28436502\n",
      "   1.21450185  0.64088239 -0.38015944  0.10489983  0.26392464  0.72986473\n",
      "   0.48185758  1.21450185  0.19346003  1.21450185 -0.13215228  1.21450185\n",
      "   0.24480546 -0.33378781  0.81842493  0.26392464  1.3034842   1.68044194\n",
      "  -0.08578066  0.01591749 -0.65940012  1.21450185  0.26392464 -1.10682248\n",
      "   0.64088239  1.21450185 -0.65940012  0.81842493  0.64088239  1.21450185\n",
      "   0.65940012 -0.36104026  0.8375441  -0.08578066  0.8375441   1.68044194\n",
      "   0.64088239 -0.36104026  1.21450185 -0.36104026  1.3034842  -0.65940012\n",
      "   0.44146718  0.64088239  0.29117709  0.64088239  0.81842493  1.21450185\n",
      "  -0.81842493  0.26392464 -0.36104026  0.8375441   1.21450185  0.24480546\n",
      "   0.38015944  1.3034842   1.68044194  0.8375441   0.18349772  1.10682248\n",
      "   1.21450185 -0.90740727  1.21450185 -0.28244237  0.8375441   0.8375441\n",
      "  -0.08578066 -0.08578066  0.64088239  0.81842493  0.81842493  0.26392464\n",
      "   1.21450185 -1.28436502 -0.65940012 -0.08578066  1.21450185  1.10682248\n",
      "   0.64088239  0.8375441   0.19346003 -1.28436502  1.21450185  0.10489983\n",
      "   0.72986473  1.68044194  1.21450185  0.01591749  1.68044194  1.3034842\n",
      "  -0.71074556  0.10489983  0.8375441   1.68044194  0.8375441   1.21450185\n",
      "   1.10682248  0.8375441   1.21450185 -0.10489983  0.81842493  0.26392464\n",
      "  -0.28244237  0.64088239  0.48185758  1.21450185  1.21450185  0.01591749\n",
      "  -0.6785193   1.21450185 -0.36104026  0.10489983 -0.36104026 -0.48185758\n",
      "   0.81842493  1.10682248 -0.6785193  -0.19346003 -0.65940012 -0.65940012\n",
      "   0.81842493 -1.10682248  1.10682248  1.10682248 -0.36104026  0.64088239\n",
      "   0.26392464  0.64088239  0.26392464  1.21450185 -0.28244237  1.68044194\n",
      "  -1.28436502  0.64088239  1.3034842   0.01591749 -0.36104026  1.10682248\n",
      "   0.26392464  1.21450185 -0.28244237  0.81842493  1.21450185 -0.08578066\n",
      "  -0.65940012  0.18349772  0.81842493  0.10489983  0.8375441   0.64088239\n",
      "   0.26392464  0.64088239  0.8375441   0.64088239  1.21450185  0.81842493\n",
      "  -0.38015944  1.21450185  0.8375441  -0.65940012  0.72986473 -0.36104026\n",
      "   0.64088239  1.21450185  1.21450185 -0.36104026  0.81842493 -1.28436502\n",
      "   0.64088239 -0.65940012 -1.28436502  0.81842493  0.26392464  0.8375441\n",
      "  -0.33378781  1.21450185  1.21450185  0.26392464  0.18349772 -1.28436502\n",
      "   1.21450185  0.29117709  0.64088239  0.64088239 -1.28436502 -0.65940012\n",
      "  -0.65940012 -0.28244237  1.21450185 -0.36104026  0.8375441   0.26392464\n",
      "  -0.65940012 -0.19346003 -0.28244237  1.10682248 -0.36104026  1.21450185\n",
      "  -0.36104026  0.75711718  0.81842493  0.24480546 -0.28244237  0.8375441\n",
      "   0.26392464  0.64088239  0.8375441   1.21450185  0.64088239  0.26392464\n",
      "  -0.65940012 -0.65940012 -1.28436502  0.64088239 -0.28244237  0.38015944\n",
      "   1.21450185  1.21450185  0.26392464  1.68044194 -0.36104026 -0.36104026\n",
      "   0.24480546  1.21450185  0.64088239 -1.05547704  0.24480546  0.81842493\n",
      "   1.21450185  1.21450185 -0.36104026 -0.28244237  0.26392464  1.68044194\n",
      "   0.10489983 -0.65940012 -1.28436502  0.26392464  0.81842493]]\n",
      "total error:  0.2408026755852843 \n",
      "\n",
      "D:  [[0.00223347 0.01306294 0.00128204 0.00562309 0.00295293 0.00128204\n",
      "  0.00128204 0.00562309 0.00223347 0.00572819 0.00331691 0.00227522\n",
      "  0.00128204 0.00819758 0.00208151 0.00223347 0.00119553 0.0019051\n",
      "  0.00227522 0.00619658 0.00572819 0.00128204 0.00128204 0.0014278\n",
      "  0.00208151 0.00338093 0.00331691 0.00186902 0.0097902  0.00080454\n",
      "  0.00119553 0.00562309 0.00227522 0.00227522 0.0083508  0.00119553\n",
      "  0.0055166  0.00671554 0.00128204 0.0055166  0.00119553 0.00338093\n",
      "  0.00331691 0.00355906 0.0019051  0.00119553 0.0156008  0.00128204\n",
      "  0.00300993 0.00119553 0.00128204 0.00819758 0.00128204 0.0019051\n",
      "  0.00300993 0.00562309 0.0019051  0.00325605 0.00212169 0.00119553\n",
      "  0.00128204 0.00227522 0.00295293 0.00479636 0.00331691 0.00208151\n",
      "  0.00266739 0.00128204 0.00355906 0.00128204 0.00378409 0.00128204\n",
      "  0.0055166  0.00309309 0.0097902  0.00562309 0.00117289 0.00080454\n",
      "  0.00396369 0.00425051 0.00223347 0.00128204 0.00331691 0.0014278\n",
      "  0.00227522 0.00128204 0.00223347 0.0097902  0.00227522 0.00128204\n",
      "  0.00223347 0.00300993 0.00186902 0.00396369 0.00186902 0.00080454\n",
      "  0.00227522 0.00300993 0.00128204 0.00619658 0.00117289 0.00223347\n",
      "  0.00277733 0.00227522 0.00577844 0.00227522 0.0019051  0.00128204\n",
      "  0.0019051  0.00562309 0.00300993 0.00186902 0.00128204 0.0055166\n",
      "  0.00295293 0.00117289 0.00080454 0.00997918 0.0035947  0.0014278\n",
      "  0.00128204 0.0017429  0.00128204 0.00325605 0.00997918 0.00186902\n",
      "  0.00470553 0.00470553 0.00819758 0.0019051  0.0097902  0.00562309\n",
      "  0.00128204 0.00119553 0.00223347 0.00396369 0.00128204 0.0014278\n",
      "  0.00227522 0.00186902 0.0052405  0.00119553 0.00128204 0.00479636\n",
      "  0.00208151 0.00080454 0.01454808 0.00425051 0.00080454 0.00117289\n",
      "  0.00212169 0.00388863 0.00186902 0.00080454 0.00186902 0.00128204\n",
      "  0.01306294 0.00186902 0.00128204 0.00479636 0.0097902  0.00331691\n",
      "  0.00325605 0.00227522 0.00699234 0.00128204 0.00128204 0.00425051\n",
      "  0.00219117 0.00128204 0.00300993 0.00388863 0.00300993 0.00266739\n",
      "  0.0019051  0.0014278  0.00219117 0.0052405  0.00223347 0.00223347\n",
      "  0.0019051  0.0014278  0.0014278  0.0014278  0.00619658 0.00227522\n",
      "  0.00331691 0.00227522 0.00331691 0.00128204 0.00572819 0.00080454\n",
      "  0.00119553 0.00227522 0.00117289 0.004388   0.00300993 0.0014278\n",
      "  0.00331691 0.00128204 0.00325605 0.0097902  0.00128204 0.00470553\n",
      "  0.00223347 0.0035947  0.0097902  0.00479636 0.00186902 0.00819758\n",
      "  0.00562309 0.00227522 0.00186902 0.00227522 0.00128204 0.0019051\n",
      "  0.00631619 0.01454808 0.00186902 0.00223347 0.00208151 0.00619658\n",
      "  0.00227522 0.00128204 0.00128204 0.00300993 0.0019051  0.00119553\n",
      "  0.00227522 0.0083508  0.00119553 0.0019051  0.00331691 0.00186902\n",
      "  0.00309309 0.00128204 0.00128204 0.00562309 0.00518855 0.00119553\n",
      "  0.00128204 0.00577844 0.00227522 0.00227522 0.00119553 0.0083508\n",
      "  0.00223347 0.00572819 0.00128204 0.00300993 0.00997918 0.00562309\n",
      "  0.0083508  0.0052405  0.00325605 0.01306294 0.00300993 0.00128204\n",
      "  0.00300993 0.00202555 0.0019051  0.00338093 0.00325605 0.00186902\n",
      "  0.00562309 0.00227522 0.00186902 0.00128204 0.00227522 0.00562309\n",
      "  0.0083508  0.0083508  0.00119553 0.00819758 0.00325605 0.00631619\n",
      "  0.00128204 0.00128204 0.00331691 0.00080454 0.00300993 0.00300993\n",
      "  0.00338093 0.00128204 0.00227522 0.00150303 0.00338093 0.0019051\n",
      "  0.00128204 0.00128204 0.00300993 0.00325605 0.00562309 0.00080454\n",
      "  0.00479636 0.00223347 0.00119553 0.00331691 0.0097902 ]]\n",
      "classEst:  [[-1. -1. -1. -1. -1.  1. -1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1. -1.\n",
      "  -1. -1.  1.  1. -1. -1.  1. -1.  1. -1. -1. -1.  1. -1.  1. -1.  1. -1.\n",
      "  -1. -1. -1. -1. -1. -1. -1. -1.  1. -1.  1. -1.  1. -1. -1. -1. -1. -1.\n",
      "   1.  1. -1.  1.  1. -1. -1.  1.  1. -1. -1. -1. -1.  1.  1. -1.  1.  1.\n",
      "  -1.  1. -1. -1. -1. -1.  1.  1. -1.  1. -1. -1. -1.  1.  1. -1.  1. -1.\n",
      "  -1.  1.  1. -1. -1.  1.  1. -1. -1. -1. -1. -1. -1. -1.  1.  1. -1. -1.\n",
      "  -1. -1.  1. -1. -1. -1.  1. -1.  1. -1. -1. -1. -1. -1. -1.  1.  1.  1.\n",
      "  -1.  1. -1.  1. -1. -1. -1.  1.  1.  1.  1. -1. -1. -1. -1. -1.  1.  1.\n",
      "   1. -1. -1.  1. -1. -1. -1.  1.  1.  1.  1. -1.  1. -1.  1. -1. -1.  1.\n",
      "  -1.  1. -1. -1.  1.  1.  1. -1. -1. -1. -1. -1. -1.  1. -1. -1.  1.  1.\n",
      "  -1. -1.  1.  1. -1. -1.  1. -1.  1. -1. -1. -1. -1. -1. -1.  1. -1. -1.\n",
      "  -1.  1.  1. -1.  1.  1.  1.  1. -1.  1.  1. -1. -1.  1.  1.  1.  1. -1.\n",
      "  -1. -1.  1. -1. -1.  1.  1. -1.  1. -1. -1.  1.  1. -1. -1. -1.  1. -1.\n",
      "   1. -1. -1.  1. -1. -1. -1.  1. -1. -1. -1.  1.  1.  1.  1. -1. -1. -1.\n",
      "  -1. -1. -1. -1. -1.  1.  1. -1.  1. -1.  1.  1.  1. -1. -1. -1. -1.  1.\n",
      "   1.  1. -1. -1. -1.  1.  1. -1.  1. -1. -1.  1. -1.  1.  1. -1. -1. -1.\n",
      "  -1. -1.  1. -1.  1. -1. -1.  1.  1.  1. -1.]]\n",
      "aggClassEst:  [[-0.81167381  0.95454879  1.06222816  0.11165095 -0.53243313  1.36677554\n",
      "   1.06222816  0.41619833 -0.50712643 -0.13016868  0.41619833  0.4886087\n",
      "   1.36677554  0.79315608  0.88213842 -0.50712643 -1.13209133  0.66615124\n",
      "   0.4886087  -0.51331395 -0.13016868  1.36677554  1.06222816  0.95454879\n",
      "   0.88213842  0.09253177  0.41619833  0.68527041  0.66615124  1.52816825\n",
      "  -1.13209133  0.11165095  0.79315608  0.4886087  -0.50712643 -1.43663871\n",
      "   0.09253177 -0.59374087  1.06222816  0.09253177 -1.43663871  0.09253177\n",
      "   0.11165095 -0.34573372 -0.66615124 -1.43663871 -1.13209133  1.06222816\n",
      "  -0.20876657 -1.43663871  1.06222816  0.4886087   1.06222816  0.66615124\n",
      "  -0.20876657  0.41619833  0.66615124 -0.13016868 -0.55847187 -1.43663871\n",
      "   1.06222816  0.79315608 -0.22788575 -0.04737386  0.11165095  0.57759104\n",
      "   0.32958389  1.36677554  0.34573372  1.06222816  0.02012141  1.36677554\n",
      "   0.09253177 -0.18151412  0.66615124  0.11165095  1.15121051  1.52816825\n",
      "   0.06649303  0.16819118 -0.81167381  1.36677554  0.11165095 -1.25909617\n",
      "   0.4886087   1.36677554 -0.50712643  0.66615124  0.79315608  1.06222816\n",
      "   0.50712643 -0.20876657  0.98981779 -0.23805435  0.68527041  1.83271563\n",
      "   0.79315608 -0.51331395  1.06222816 -0.51331395  1.15121051 -0.81167381\n",
      "   0.28919349  0.4886087   0.44345078  0.79315608  0.66615124  1.06222816\n",
      "  -0.97069862  0.11165095 -0.20876657  0.68527041  1.06222816  0.09253177\n",
      "   0.53243313  1.15121051  1.83271563  0.68527041  0.03122403  0.95454879\n",
      "   1.06222816 -1.05968096  1.06222816 -0.13016868  0.98981779  0.98981779\n",
      "  -0.23805435  0.06649303  0.4886087   0.97069862  0.66615124  0.11165095\n",
      "   1.06222816 -1.13209133 -0.50712643  0.06649303  1.36677554  0.95454879\n",
      "   0.4886087   0.68527041  0.04118634 -1.43663871  1.36677554  0.25717352\n",
      "   0.88213842  1.52816825  1.06222816  0.16819118  1.52816825  1.15121051\n",
      "  -0.86301925  0.25717352  0.98981779  1.83271563  0.98981779  1.06222816\n",
      "   1.25909617  0.68527041  1.36677554 -0.25717352  0.66615124  0.41619833\n",
      "  -0.43471606  0.79315608  0.32958389  1.06222816  1.36677554  0.16819118\n",
      "  -0.52624561  1.06222816 -0.51331395 -0.04737386 -0.51331395 -0.63413127\n",
      "   0.66615124  1.25909617 -0.83079299 -0.34573372 -0.50712643 -0.50712643\n",
      "   0.66615124 -1.25909617  1.25909617  1.25909617 -0.51331395  0.4886087\n",
      "   0.41619833  0.4886087   0.41619833  1.06222816 -0.43471606  1.52816825\n",
      "  -1.43663871  0.4886087   1.15121051  0.16819118 -0.51331395  0.95454879\n",
      "   0.11165095  1.36677554 -0.13016868  0.66615124  1.36677554  0.06649303\n",
      "  -0.50712643  0.33577141  0.66615124  0.25717352  0.98981779  0.4886087\n",
      "   0.11165095  0.79315608  0.98981779  0.79315608  1.36677554  0.66615124\n",
      "  -0.53243313  1.06222816  0.98981779 -0.81167381  0.57759104 -0.20876657\n",
      "   0.79315608  1.06222816  1.36677554 -0.51331395  0.66615124 -1.13209133\n",
      "   0.79315608 -0.81167381 -1.43663871  0.66615124  0.41619833  0.68527041\n",
      "  -0.18151412  1.06222816  1.06222816  0.41619833  0.03122403 -1.43663871\n",
      "   1.06222816  0.44345078  0.4886087   0.4886087  -1.43663871 -0.50712643\n",
      "  -0.50712643 -0.13016868  1.36677554 -0.51331395  0.68527041  0.11165095\n",
      "  -0.81167381 -0.34573372 -0.43471606  0.95454879 -0.51331395  1.36677554\n",
      "  -0.20876657  0.60484349  0.97069862  0.09253177 -0.13016868  0.98981779\n",
      "   0.41619833  0.4886087   0.68527041  1.06222816  0.4886087   0.41619833\n",
      "  -0.50712643 -0.50712643 -1.43663871  0.4886087  -0.43471606  0.53243313\n",
      "   1.36677554  1.06222816  0.41619833  1.52816825 -0.51331395 -0.20876657\n",
      "   0.09253177  1.36677554  0.79315608 -1.20775073  0.09253177  0.66615124\n",
      "   1.06222816  1.06222816 -0.20876657 -0.43471606  0.41619833  1.52816825\n",
      "  -0.04737386 -0.50712643 -1.13209133  0.41619833  0.66615124]]\n",
      "total error:  0.2408026755852843 \n",
      "\n",
      "D:  [[0.00194028 0.01134815 0.00151025 0.00488494 0.00256529 0.00111375\n",
      "  0.00151025 0.00662403 0.00263104 0.00497624 0.00288149 0.00268022\n",
      "  0.00111375 0.0096568  0.00180826 0.00263104 0.00140834 0.00224421\n",
      "  0.00268022 0.0072996  0.00497624 0.00111375 0.00151025 0.00168196\n",
      "  0.00180826 0.00398276 0.00288149 0.00220171 0.00850503 0.00094775\n",
      "  0.00140834 0.00488494 0.00197654 0.00268022 0.00725458 0.00103859\n",
      "  0.00479243 0.00791094 0.00151025 0.00479243 0.00103859 0.00398276\n",
      "  0.00390733 0.00309186 0.00224421 0.00103859 0.01355286 0.00151025\n",
      "  0.00354571 0.00103859 0.00151025 0.00712147 0.00151025 0.00224421\n",
      "  0.00354571 0.00662403 0.00224421 0.00383564 0.00249936 0.00103859\n",
      "  0.00151025 0.00197654 0.00347857 0.00416673 0.00390733 0.00245203\n",
      "  0.0031422  0.00111375 0.00309186 0.00151025 0.00445768 0.00111375\n",
      "  0.00479243 0.00364367 0.00850503 0.00488494 0.00138167 0.00094775\n",
      "  0.00466925 0.00369254 0.00194028 0.00111375 0.00390733 0.00124037\n",
      "  0.00268022 0.00111375 0.00263104 0.00850503 0.00197654 0.00151025\n",
      "  0.00263104 0.00354571 0.00162367 0.00344337 0.00220171 0.00069893\n",
      "  0.00197654 0.00261481 0.00151025 0.0072996  0.00138167 0.00194028\n",
      "  0.00327171 0.00268022 0.00680704 0.00197654 0.00224421 0.00151025\n",
      "  0.00165501 0.00488494 0.00354571 0.00220171 0.00151025 0.00479243\n",
      "  0.00256529 0.00138167 0.00069893 0.0086692  0.00423457 0.00168196\n",
      "  0.00151025 0.00151411 0.00151025 0.00383564 0.01175553 0.00162367\n",
      "  0.00554314 0.00408783 0.00712147 0.00165501 0.00850503 0.00488494\n",
      "  0.00151025 0.00140834 0.00263104 0.00466925 0.00111375 0.00168196\n",
      "  0.00268022 0.00220171 0.00455257 0.00103859 0.00111375 0.00565014\n",
      "  0.00180826 0.00094775 0.01263833 0.00369254 0.00094775 0.00138167\n",
      "  0.00184317 0.00337816 0.00162367 0.00069893 0.00162367 0.00151025\n",
      "  0.01538822 0.00220171 0.00111375 0.00565014 0.00850503 0.00288149\n",
      "  0.00282862 0.00197654 0.00607444 0.00151025 0.00111375 0.00369254\n",
      "  0.00258122 0.00151025 0.00261481 0.00458083 0.00261481 0.00231724\n",
      "  0.00224421 0.00124037 0.00190354 0.00617334 0.00263104 0.00263104\n",
      "  0.00224421 0.00124037 0.00124037 0.00124037 0.0072996  0.00268022\n",
      "  0.00288149 0.00268022 0.00288149 0.00151025 0.00674784 0.00094775\n",
      "  0.00103859 0.00268022 0.00138167 0.00516909 0.00261481 0.00168196\n",
      "  0.00390733 0.00111375 0.00383564 0.00850503 0.00111375 0.00408783\n",
      "  0.00263104 0.00312281 0.00850503 0.00565014 0.00162367 0.00712147\n",
      "  0.00488494 0.00197654 0.00162367 0.00197654 0.00111375 0.00224421\n",
      "  0.00744051 0.01263833 0.00162367 0.00194028 0.00245203 0.00538314\n",
      "  0.00197654 0.00151025 0.00111375 0.00261481 0.00224421 0.00140834\n",
      "  0.00197654 0.00983729 0.00103859 0.00224421 0.00288149 0.00220171\n",
      "  0.00364367 0.00151025 0.00151025 0.00662403 0.00450744 0.00103859\n",
      "  0.00151025 0.00680704 0.00268022 0.00268022 0.00103859 0.00725458\n",
      "  0.00263104 0.00497624 0.00111375 0.00261481 0.0086692  0.00488494\n",
      "  0.00983729 0.00617334 0.00282862 0.01134815 0.00261481 0.00111375\n",
      "  0.00354571 0.00238611 0.00165501 0.00398276 0.00383564 0.00162367\n",
      "  0.00662403 0.00268022 0.00220171 0.00151025 0.00268022 0.00662403\n",
      "  0.00725458 0.00725458 0.00103859 0.00712147 0.00282862 0.00744051\n",
      "  0.00111375 0.00151025 0.00288149 0.00094775 0.00261481 0.00354571\n",
      "  0.00398276 0.00111375 0.00197654 0.00130572 0.00398276 0.00224421\n",
      "  0.00151025 0.00151025 0.00354571 0.00282862 0.00662403 0.00094775\n",
      "  0.00416673 0.00263104 0.00140834 0.00288149 0.00850503]]\n",
      "classEst:  [[ 1. -1. -1. -1. -1. -1.  1.  1. -1.  1. -1. -1.  1. -1.  1. -1. -1.  1.\n",
      "  -1. -1. -1.  1. -1.  1. -1.  1. -1.  1.  1.  1. -1. -1.  1.  1. -1. -1.\n",
      "  -1.  1.  1.  1. -1.  1. -1. -1. -1. -1. -1.  1. -1. -1. -1. -1. -1.  1.\n",
      "   1. -1.  1. -1. -1. -1. -1.  1. -1. -1. -1. -1. -1.  1. -1.  1.  1.  1.\n",
      "   1. -1.  1. -1.  1.  1. -1. -1. -1.  1. -1. -1. -1. -1. -1.  1. -1.  1.\n",
      "   1.  1.  1.  1. -1. -1. -1. -1. -1. -1.  1. -1.  1.  1. -1. -1. -1. -1.\n",
      "  -1. -1. -1.  1.  1.  1. -1.  1.  1. -1.  1. -1. -1. -1.  1. -1. -1.  1.\n",
      "  -1.  1. -1.  1.  1.  1.  1. -1. -1. -1.  1. -1.  1.  1. -1. -1.  1. -1.\n",
      "  -1. -1. -1. -1.  1.  1. -1. -1.  1. -1. -1.  1. -1.  1. -1.  1.  1.  1.\n",
      "  -1. -1. -1.  1.  1. -1.  1. -1. -1. -1. -1. -1.  1. -1. -1. -1. -1. -1.\n",
      "   1. -1. -1. -1. -1.  1.  1.  1.  1. -1.  1.  1. -1. -1.  1. -1.  1.  1.\n",
      "  -1. -1. -1.  1.  1. -1. -1. -1.  1. -1.  1. -1. -1. -1. -1.  1.  1.  1.\n",
      "   1. -1. -1.  1.  1. -1. -1.  1.  1. -1.  1. -1.  1.  1. -1.  1. -1. -1.\n",
      "  -1.  1. -1. -1.  1. -1. -1. -1.  1. -1. -1. -1. -1. -1.  1. -1. -1. -1.\n",
      "  -1. -1.  1.  1. -1.  1.  1.  1.  1.  1. -1. -1.  1. -1. -1.  1.  1.  1.\n",
      "  -1. -1. -1.  1. -1.  1. -1.  1.  1.  1. -1. -1.  1.  1.  1.  1.  1.  1.\n",
      "   1. -1. -1. -1. -1.  1. -1. -1. -1. -1.  1.]]\n",
      "aggClassEst:  [[-0.6565651   0.79944008  0.90711945 -0.04345776 -0.68754184  1.21166683\n",
      "   1.21733687  0.57130704 -0.66223514  0.02494003  0.26108962  0.33349999\n",
      "   1.52188425  0.63804737  1.03724713 -0.66223514 -1.28720004  0.82125995\n",
      "   0.33349999 -0.66842266 -0.28527739  1.52188425  0.90711945  1.1096575\n",
      "   0.72702971  0.24764048  0.26108962  0.84037912  0.82125995  1.68327696\n",
      "  -1.28720004 -0.04345776  0.94826478  0.6437174  -0.66223514 -1.59174742\n",
      "  -0.06257693 -0.43863216  1.21733687  0.24764048 -1.59174742  0.24764048\n",
      "  -0.04345776 -0.50084242 -0.82125995 -1.59174742 -1.28720004  1.21733687\n",
      "  -0.36387528 -1.59174742  0.90711945  0.33349999  0.90711945  0.82125995\n",
      "  -0.05365786  0.26108962  0.82125995 -0.28527739 -0.71358057 -1.59174742\n",
      "   0.90711945  0.94826478 -0.38299446 -0.20248257 -0.04345776  0.42248233\n",
      "   0.17447518  1.52188425  0.19062501  1.21733687  0.17523011  1.52188425\n",
      "   0.24764048 -0.33662283  0.82125995 -0.04345776  1.30631921  1.68327696\n",
      "  -0.08861567  0.01308247 -0.96678252  1.52188425 -0.04345776 -1.41420488\n",
      "   0.33349999  1.21166683 -0.66223514  0.82125995  0.63804737  1.21733687\n",
      "   0.66223514 -0.05365786  1.1449265  -0.08294564  0.53016171  1.67760692\n",
      "   0.63804737 -0.66842266  0.90711945 -0.66842266  1.30631921 -0.96678252\n",
      "   0.4443022   0.6437174   0.28834207  0.63804737  0.51104253  0.90711945\n",
      "  -1.12580733 -0.04345776 -0.36387528  0.84037912  1.21733687  0.24764048\n",
      "   0.37732442  1.30631921  1.98782434  0.53016171  0.18633274  0.79944008\n",
      "   0.90711945 -1.21478967  1.21733687 -0.28527739  0.83470909  1.1449265\n",
      "  -0.39316305  0.22160174  0.33349999  1.12580733  0.82125995  0.26675966\n",
      "   1.21733687 -1.28720004 -0.66223514 -0.08861567  1.52188425  0.79944008\n",
      "   0.6437174   0.84037912 -0.11392237 -1.59174742  1.52188425  0.10206481\n",
      "   0.72702971  1.37305954  0.90711945  0.01308247  1.68327696  1.30631921\n",
      "  -1.01812795  0.10206481  1.1449265   1.67760692  0.83470909  1.21733687\n",
      "   1.10398746  0.84037912  1.21166683 -0.10206481  0.82125995  0.57130704\n",
      "  -0.58982477  0.63804737  0.17447518  1.21733687  1.52188425  0.01308247\n",
      "  -0.3711369   0.90711945 -0.66842266 -0.20248257 -0.66842266 -0.78923998\n",
      "   0.82125995  1.10398746 -0.98590169 -0.50084242 -0.66223514 -0.66223514\n",
      "   0.82125995 -1.41420488  1.10398746  1.10398746 -0.66842266  0.6437174\n",
      "   0.57130704  0.6437174   0.57130704  0.90711945 -0.27960735  1.68327696\n",
      "  -1.59174742  0.33349999  1.30631921  0.01308247 -0.35820524  1.1096575\n",
      "  -0.04345776  1.21166683 -0.28527739  0.82125995  1.52188425 -0.08861567\n",
      "  -0.66223514  0.1806627   0.82125995  0.10206481  1.1449265   0.33349999\n",
      "  -0.04345776  0.63804737  0.83470909  0.94826478  1.52188425  0.82125995\n",
      "  -0.37732442  0.90711945  0.83470909 -0.6565651   0.73269975 -0.36387528\n",
      "   0.63804737  1.21733687  1.52188425 -0.66842266  0.82125995 -1.28720004\n",
      "   0.94826478 -0.6565651  -1.59174742  0.82125995  0.26108962  0.53016171\n",
      "  -0.33662283  1.21733687  0.90711945  0.26108962  0.18633274 -1.59174742\n",
      "   0.90711945  0.28834207  0.6437174   0.33349999 -1.59174742 -0.66223514\n",
      "  -0.66223514 -0.28527739  1.52188425 -0.66842266  0.53016171 -0.04345776\n",
      "  -0.96678252 -0.50084242 -0.27960735  1.1096575  -0.66842266  1.52188425\n",
      "  -0.05365786  0.7599522   1.12580733  0.24764048 -0.28527739  0.83470909\n",
      "   0.57130704  0.33349999  0.53016171  1.21733687  0.6437174   0.57130704\n",
      "  -0.66223514 -0.66223514 -1.59174742  0.6437174  -0.58982477  0.68754184\n",
      "   1.21166683  1.21733687  0.57130704  1.68327696 -0.66842266 -0.36387528\n",
      "   0.24764048  1.52188425  0.94826478 -1.05264202  0.24764048  0.82125995\n",
      "   1.21733687  0.90711945 -0.36387528 -0.58982477  0.26108962  1.68327696\n",
      "  -0.20248257 -0.66223514 -1.28720004  0.26108962  0.82125995]]\n",
      "total error:  0.22073578595317725 \n",
      "\n",
      "D:  [[0.00229314 0.0098348  0.00178491 0.0042335  0.0022232  0.00131629\n",
      "  0.00130885 0.00782869 0.00228018 0.00431263 0.00340552 0.00316764\n",
      "  0.00096522 0.008369   0.00156712 0.00228018 0.00122053 0.00194493\n",
      "  0.00316764 0.00862712 0.00588122 0.00096522 0.00178491 0.00145766\n",
      "  0.00213712 0.00345163 0.00340552 0.0019081  0.01005176 0.00082136\n",
      "  0.00122053 0.0042335  0.00171296 0.00232279 0.0085739  0.00090009\n",
      "  0.00415333 0.00685597 0.00130885 0.00566399 0.00090009 0.00345163\n",
      "  0.00461792 0.00267954 0.00194493 0.00090009 0.01601759 0.00130885\n",
      "  0.00307287 0.00090009 0.00178491 0.00617178 0.00178491 0.00194493\n",
      "  0.00419054 0.00574068 0.00194493 0.00332414 0.00216605 0.00090009\n",
      "  0.00178491 0.00171296 0.00301468 0.00361107 0.00461792 0.00289795\n",
      "  0.00371364 0.00096522 0.00365415 0.00130885 0.00526835 0.00096522\n",
      "  0.00566399 0.00315777 0.01005176 0.0042335  0.00119742 0.00082136\n",
      "  0.00404658 0.00436407 0.00168153 0.00096522 0.00461792 0.00107496\n",
      "  0.00316764 0.00131629 0.00228018 0.01005176 0.002336   0.00130885\n",
      "  0.00228018 0.00419054 0.00140714 0.00406959 0.00260212 0.00082603\n",
      "  0.002336   0.00226611 0.00178491 0.00862712 0.00119742 0.00168153\n",
      "  0.00283541 0.00232279 0.00589928 0.002336   0.00265235 0.00178491\n",
      "  0.0014343  0.0042335  0.00307287 0.0019081  0.00130885 0.00566399\n",
      "  0.00303182 0.00119742 0.00060572 0.00751311 0.00366986 0.00198784\n",
      "  0.00178491 0.00131219 0.00130885 0.00332414 0.01018786 0.00140714\n",
      "  0.00655122 0.00354269 0.00617178 0.0014343  0.01005176 0.00577332\n",
      "  0.00130885 0.00122053 0.00228018 0.00404658 0.00096522 0.00198784\n",
      "  0.00232279 0.0019081  0.00394546 0.00090009 0.00096522 0.00489666\n",
      "  0.00213712 0.00112011 0.01095293 0.00436407 0.00082136 0.00119742\n",
      "  0.00159737 0.00399252 0.00140714 0.00082603 0.00191895 0.00130885\n",
      "  0.0133361  0.0019081  0.00131629 0.00489666 0.01005176 0.00249723\n",
      "  0.00245141 0.002336   0.00526438 0.00130885 0.00096522 0.00436407\n",
      "  0.00305064 0.00178491 0.00226611 0.0054139  0.00226611 0.00200822\n",
      "  0.00194493 0.00146594 0.00164969 0.00729603 0.00228018 0.00228018\n",
      "  0.00194493 0.00107496 0.00146594 0.00146594 0.00862712 0.00232279\n",
      "  0.00249723 0.00232279 0.00249723 0.00178491 0.00584797 0.00082136\n",
      "  0.00090009 0.00316764 0.00119742 0.00447976 0.00309034 0.00145766\n",
      "  0.00461792 0.00131629 0.00332414 0.01005176 0.00096522 0.00483124\n",
      "  0.00228018 0.00369073 0.01005176 0.00489666 0.00140714 0.00617178\n",
      "  0.0042335  0.002336   0.00191895 0.00171296 0.00096522 0.00194493\n",
      "  0.00644827 0.01095293 0.00191895 0.00229314 0.00212503 0.00636213\n",
      "  0.002336   0.00130885 0.00096522 0.00226611 0.00194493 0.00122053\n",
      "  0.00171296 0.00852542 0.00090009 0.00194493 0.00340552 0.00260212\n",
      "  0.00315777 0.00130885 0.00178491 0.00574068 0.00532717 0.00090009\n",
      "  0.00178491 0.00589928 0.00232279 0.00316764 0.00090009 0.0085739\n",
      "  0.00228018 0.00588122 0.00096522 0.00226611 0.00751311 0.0042335\n",
      "  0.0116263  0.00729603 0.00334304 0.01341194 0.00226611 0.00096522\n",
      "  0.00419054 0.0020679  0.0014343  0.00345163 0.00332414 0.00191895\n",
      "  0.00782869 0.00316764 0.00260212 0.00130885 0.00232279 0.00782869\n",
      "  0.0085739  0.0085739  0.00090009 0.00841659 0.00245141 0.00879365\n",
      "  0.00131629 0.00130885 0.00249723 0.00082136 0.00226611 0.00307287\n",
      "  0.00345163 0.00096522 0.00171296 0.00154318 0.00345163 0.00194493\n",
      "  0.00130885 0.00178491 0.00307287 0.00245141 0.00574068 0.00082136\n",
      "  0.00361107 0.00228018 0.00122053 0.00340552 0.01005176]]\n",
      "classEst:  [[ 1. -1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.\n",
      "   1.  1.  1.  1.  1. -1.  1. -1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.\n",
      "  -1. -1.  1. -1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.\n",
      "   1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "  -1.  1. -1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1. -1.  1.  1.\n",
      "  -1.  1.  1.  1.  1. -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.\n",
      "   1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1.\n",
      "   1.  1. -1. -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.\n",
      "   1.  1.  1. -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1. -1.  1.\n",
      "   1.  1. -1.  1.  1.  1. -1.  1.  1.  1.  1.  1. -1.  1. -1.  1.  1.  1.\n",
      "  -1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1.  1. -1.  1.  1.  1.  1. -1.  1.  1. -1.  1.  1.  1.  1.  1. -1.\n",
      "  -1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1. -1.  1.  1. -1.  1.  1.\n",
      "   1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1.  1.  1.  1.  1.  1. -1.  1. -1. -1.  1.  1.  1.  1. -1.  1.  1.\n",
      "   1.  1.  1. -1.  1.  1.  1.  1.  1. -1.  1.  1. -1.  1.  1.  1. -1. -1.\n",
      "  -1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.]]\n",
      "aggClassEst:  [[-0.52120313  0.66407811  1.04248143  0.09190421 -0.82290381  1.34702881\n",
      "   1.35269884  0.70666901 -0.52687316  0.160302    0.39645159  0.46886196\n",
      "   1.65724622  0.77340934  1.1726091  -0.52687316 -1.15183806  0.68589797\n",
      "   0.46886196 -0.53306069 -0.14991542  1.65724622  1.04248143  0.97429552\n",
      "   0.86239169  0.11227851  0.39645159  0.9757411   0.68589797  1.81863893\n",
      "  -1.15183806  0.09190421  1.08362676  0.77907938 -0.52687316 -1.45638544\n",
      "  -0.19793891 -0.57399414  1.35269884  0.11227851 -1.45638544  0.11227851\n",
      "   0.09190421 -0.36548045 -0.68589797 -1.45638544 -1.15183806  1.35269884\n",
      "  -0.22851331 -1.45638544  1.04248143  0.46886196  1.04248143  0.68589797\n",
      "   0.08170411  0.39645159  0.68589797 -0.14991542 -0.5782186  -1.45638544\n",
      "   1.04248143  1.08362676 -0.24763248 -0.06712059  0.09190421  0.55784431\n",
      "   0.30983715  1.65724622  0.32598698  1.35269884  0.31059209  1.65724622\n",
      "   0.11227851 -0.20126085  0.68589797  0.09190421  1.44168119  1.81863893\n",
      "   0.0467463   0.14844444 -0.83142054  1.38652227  0.09190421 -1.2788429\n",
      "   0.46886196  1.34702881 -0.52687316  0.68589797  0.77340934  1.35269884\n",
      "   0.52687316  0.08170411  1.28028848  0.05241634  0.66552368  1.54224495\n",
      "   0.50268539 -0.53306069  1.04248143 -0.53306069  1.44168119 -0.83142054\n",
      "   0.57966417  0.77907938  0.42370405  0.77340934  0.37568056  1.04248143\n",
      "  -0.99044535  0.09190421 -0.22851331  0.9757411   1.35269884  0.11227851\n",
      "   0.51268639  1.44168119  2.12318631  0.66552368  0.32169471  0.93480205\n",
      "   1.04248143 -1.35015164  1.35269884 -0.14991542  0.97007106  1.28028848\n",
      "  -0.25780108  0.35696372  0.19813801  0.99044535  0.68589797  0.40212163\n",
      "   1.35269884 -1.15183806 -0.52687316  0.0467463   1.65724622  0.93480205\n",
      "   0.77907938  0.9757411  -0.24928435 -1.45638544  1.65724622  0.23742679\n",
      "   0.86239169  1.50842152  1.04248143 -0.12227951  1.54791499  1.44168119\n",
      "  -0.88276598  0.23742679  1.28028848  1.8129689   0.97007106  1.35269884\n",
      "   1.23934943  0.9757411   1.34702881 -0.23742679  0.68589797  0.70666901\n",
      "  -0.4544628   0.77340934  0.03911321  1.35269884  1.65724622  0.14844444\n",
      "  -0.50649887  1.04248143 -0.53306069 -0.06712059 -0.53306069 -0.653878\n",
      "   0.68589797  1.23934943 -1.12126367 -0.36548045 -0.52687316 -0.52687316\n",
      "   0.68589797 -1.2788429   1.23934943  1.23934943 -0.53306069  0.77907938\n",
      "   0.70666901  0.77907938  0.70666901  0.77175748 -0.14424538  1.81863893\n",
      "  -1.45638544  0.46886196  1.44168119  0.14844444 -0.22284327  1.24501947\n",
      "   0.09190421  1.34702881 -0.14991542  0.68589797  1.65724622  0.0467463\n",
      "  -0.52687316  0.31602468  0.68589797  0.23742679  1.28028848  0.19813801\n",
      "   0.09190421  0.77340934  0.97007106  1.08362676  1.65724622  0.68589797\n",
      "  -0.51268639  1.04248143  0.97007106 -0.52120313  0.86806172 -0.22851331\n",
      "   0.77340934  1.35269884  1.65724622 -0.53306069  0.68589797 -1.15183806\n",
      "   0.81290281 -0.52120313 -1.45638544  0.68589797  0.39645159  0.66552368\n",
      "  -0.20126085  1.35269884  1.04248143  0.39645159  0.05097077 -1.45638544\n",
      "   1.04248143  0.42370405  0.77907938  0.46886196 -1.45638544 -0.52687316\n",
      "  -0.52687316 -0.14991542  1.65724622 -0.53306069  0.66552368  0.09190421\n",
      "  -0.83142054 -0.36548045 -0.14424538  1.24501947 -0.53306069  1.65724622\n",
      "   0.08170411  0.62459023  1.2611693   0.11227851 -0.42063936  0.97007106\n",
      "   0.70666901  0.46886196  0.66552368  1.0819749   0.77907938  0.70666901\n",
      "  -0.52687316 -0.52687316 -1.45638544  0.50835543 -0.4544628   0.82290381\n",
      "   1.34702881  1.35269884  0.70666901  1.54791499 -0.53306069 -0.22851331\n",
      "   0.11227851  1.65724622  1.08362676 -0.91728005  0.11227851  0.68589797\n",
      "   1.0819749   1.04248143 -0.22851331 -0.4544628   0.39645159  1.81863893\n",
      "  -0.06712059 -0.52687316 -1.15183806  0.39645159  0.68589797]]\n",
      "total error:  0.24749163879598662 \n",
      "\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "D:  [[0.00264962 0.00866853 0.00157324 0.00489163 0.00195955 0.0011602\n",
      "  0.00115364 0.00904571 0.00263464 0.00380121 0.00300167 0.002792\n",
      "  0.00085076 0.00967002 0.00138128 0.00263464 0.00141027 0.00224729\n",
      "  0.002792   0.00760406 0.00518379 0.00085076 0.00157324 0.00168426\n",
      "  0.00188368 0.00398821 0.00300167 0.00168183 0.00885975 0.00072396\n",
      "  0.00141027 0.00489163 0.00150983 0.00204734 0.00755715 0.00104002\n",
      "  0.0036608  0.00792177 0.00115364 0.00499231 0.00104002 0.00398821\n",
      "  0.0040703  0.00309609 0.00224729 0.00104002 0.01411812 0.00115364\n",
      "  0.00355057 0.00104002 0.00157324 0.00713123 0.00157324 0.00224729\n",
      "  0.00484199 0.0066331  0.00224729 0.0038409  0.00250278 0.00104002\n",
      "  0.00157324 0.00150983 0.00348333 0.00417244 0.0040703  0.0025543\n",
      "  0.00327325 0.00085076 0.00322081 0.00115364 0.00608735 0.00085076\n",
      "  0.00499231 0.00364866 0.00885975 0.00489163 0.00105542 0.00072396\n",
      "  0.00467565 0.00384655 0.00194294 0.00111527 0.0040703  0.00124207\n",
      "  0.002792   0.0011602  0.00263464 0.00885975 0.00205898 0.00115364\n",
      "  0.00263464 0.00484199 0.00124027 0.00470223 0.00229354 0.00095445\n",
      "  0.00269915 0.00261839 0.00157324 0.00760406 0.00105542 0.00194294\n",
      "  0.00249917 0.00204734 0.00681636 0.00205898 0.00306467 0.00157324\n",
      "  0.00165728 0.00489163 0.00355057 0.00168183 0.00115364 0.00499231\n",
      "  0.00267229 0.00105542 0.00053389 0.00868107 0.00323467 0.00175211\n",
      "  0.00157324 0.00115658 0.00115364 0.0038409  0.01177163 0.00124027\n",
      "  0.00577433 0.00312257 0.00543989 0.00165728 0.00885975 0.00667082\n",
      "  0.00115364 0.00141027 0.00263464 0.00467565 0.00085076 0.00175211\n",
      "  0.00204734 0.00168183 0.00347758 0.00104002 0.00085076 0.00565787\n",
      "  0.00188368 0.00098728 0.01265563 0.00504249 0.00094905 0.00105542\n",
      "  0.00184569 0.00351906 0.00124027 0.00072808 0.00169139 0.00115364\n",
      "  0.01540929 0.00168183 0.0011602  0.00565787 0.00885975 0.00220109\n",
      "  0.0028325  0.00205898 0.00464009 0.00115364 0.00085076 0.00384655\n",
      "  0.00268887 0.00157324 0.00261839 0.00477189 0.00261839 0.00232041\n",
      "  0.00224729 0.0012921  0.00145406 0.00643082 0.00263464 0.00263464\n",
      "  0.00224729 0.00124207 0.0012921  0.0012921  0.00760406 0.00204734\n",
      "  0.00220109 0.00204734 0.00220109 0.00206239 0.00515448 0.00072396\n",
      "  0.00104002 0.002792   0.00105542 0.00517617 0.00357076 0.0012848\n",
      "  0.0040703  0.0011602  0.0038409  0.00885975 0.00085076 0.00425832\n",
      "  0.00263464 0.00325306 0.00885975 0.00565787 0.00124027 0.00543989\n",
      "  0.00489163 0.00205898 0.00169139 0.00150983 0.00085076 0.00224729\n",
      "  0.0074507  0.01265563 0.00169139 0.00264962 0.00187303 0.00560767\n",
      "  0.00205898 0.00115364 0.00085076 0.00261839 0.00224729 0.00141027\n",
      "  0.00197925 0.00751442 0.00104002 0.00224729 0.00300167 0.00229354\n",
      "  0.00364866 0.00115364 0.00157324 0.0066331  0.00469544 0.00104002\n",
      "  0.00157324 0.00681636 0.00204734 0.002792   0.00104002 0.00755715\n",
      "  0.00263464 0.00518379 0.00085076 0.00261839 0.00868107 0.00489163\n",
      "  0.01024758 0.00643082 0.00386274 0.01549691 0.00261839 0.00085076\n",
      "  0.00484199 0.00238937 0.00126422 0.00398821 0.00292994 0.00169139\n",
      "  0.00904571 0.002792   0.00229354 0.00151232 0.00204734 0.00904571\n",
      "  0.00755715 0.00755715 0.00104002 0.0074185  0.0028325  0.01016068\n",
      "  0.0011602  0.00115364 0.00220109 0.00094905 0.00261839 0.00355057\n",
      "  0.00398821 0.00085076 0.00150983 0.00178308 0.00398821 0.00224729\n",
      "  0.00151232 0.00157324 0.00355057 0.0028325  0.0066331  0.00072396\n",
      "  0.00417244 0.00263464 0.00141027 0.00300167 0.00885975]]\n",
      "classEst:  [[-1. -1. -1.  1.  1. -1. -1. -1.  1. -1. -1.  1. -1. -1. -1.  1.  1. -1.\n",
      "  -1.  1.  1. -1.  1.  1. -1.  1.  1. -1. -1. -1.  1. -1. -1. -1.  1. -1.\n",
      "  -1. -1. -1.  1. -1.  1. -1. -1. -1. -1. -1. -1.  1.  1. -1.  1. -1. -1.\n",
      "   1. -1. -1.  1. -1. -1.  1. -1. -1. -1.  1.  1. -1. -1. -1. -1. -1. -1.\n",
      "  -1. -1. -1. -1. -1. -1. -1. -1.  1. -1.  1. -1.  1.  1.  1. -1.  1. -1.\n",
      "  -1.  1. -1. -1.  1. -1.  1.  1.  1.  1. -1. -1. -1.  1. -1.  1.  1.  1.\n",
      "   1.  1. -1. -1. -1. -1. -1.  1. -1. -1.  1. -1.  1.  1. -1. -1. -1.  1.\n",
      "  -1.  1. -1. -1. -1.  1. -1. -1.  1. -1. -1. -1.  1. -1.  1. -1. -1.  1.\n",
      "   1. -1. -1. -1. -1. -1. -1. -1. -1.  1. -1. -1. -1.  1. -1. -1. -1. -1.\n",
      "  -1. -1.  1. -1. -1.  1. -1. -1. -1.  1. -1. -1. -1.  1. -1.  1. -1.  1.\n",
      "  -1. -1. -1.  1.  1.  1.  1. -1. -1. -1.  1. -1.  1. -1. -1. -1.  1. -1.\n",
      "   1. -1. -1.  1. -1. -1. -1.  1. -1.  1. -1. -1. -1.  1. -1.  1. -1. -1.\n",
      "  -1.  1. -1.  1.  1. -1. -1. -1. -1. -1. -1.  1.  1.  1. -1. -1.  1.  1.\n",
      "  -1. -1.  1. -1. -1.  1. -1.  1. -1.  1. -1.  1. -1.  1. -1.  1. -1.  1.\n",
      "  -1. -1.  1. -1. -1. -1.  1. -1. -1. -1.  1. -1.  1. -1. -1. -1.  1.  1.\n",
      "  -1.  1. -1. -1.  1. -1.  1. -1.  1. -1. -1. -1. -1. -1. -1. -1.  1. -1.\n",
      "   1. -1.  1. -1. -1. -1.  1. -1.  1. -1. -1.]]\n",
      "aggClassEst:  [[-0.646419    0.53886223  0.91726555  0.21712009 -0.69768794  1.22181293\n",
      "   1.22748297  0.58145314 -0.40165729  0.03508613  0.27123572  0.59407783\n",
      "   1.53203035  0.64819347  1.04739323 -0.40165729 -1.02662219  0.5606821\n",
      "   0.34364609 -0.40784481 -0.02469954  1.53203035  1.1676973   1.0995114\n",
      "   0.73717581  0.23749438  0.52166747  0.85052522  0.5606821   1.69342306\n",
      "  -1.02662219 -0.03331166  0.95841088  0.6538635  -0.40165729 -1.58160132\n",
      "  -0.32315478 -0.69921001  1.22748297  0.23749438 -1.58160132  0.23749438\n",
      "  -0.03331166 -0.49069632 -0.81111385 -1.58160132 -1.27705394  1.22748297\n",
      "  -0.10329743 -1.33116957  0.91726555  0.59407783  0.91726555  0.5606821\n",
      "   0.20691998  0.27123572  0.5606821  -0.02469954 -0.70343447 -1.58160132\n",
      "   1.1676973   0.95841088 -0.37284836 -0.19233647  0.21712009  0.68306018\n",
      "   0.18462128  1.53203035  0.20077111  1.22748297  0.18537621  1.53203035\n",
      "  -0.01293737 -0.32647673  0.5606821  -0.03331166  1.31646531  1.69342306\n",
      "  -0.07846957  0.02322857 -0.70620467  1.2613064   0.21712009 -1.40405878\n",
      "   0.59407783  1.47224468 -0.40165729  0.5606821   0.89862521  1.22748297\n",
      "   0.40165729  0.20691998  1.1550726  -0.07279954  0.79073955  1.41702908\n",
      "   0.62790127 -0.40784481  1.1676973  -0.40784481  1.31646531 -0.95663642\n",
      "   0.4544483   0.90429525  0.29848817  0.89862521  0.50089643  1.1676973\n",
      "  -0.86522948  0.21712009 -0.35372918  0.85052522  1.22748297 -0.01293737\n",
      "   0.38747052  1.56689706  1.99797044  0.54030781  0.44691059  0.80958618\n",
      "   1.1676973  -1.22493577  1.22748297 -0.27513129  0.84485519  1.40550435\n",
      "  -0.38301695  0.48217959  0.07292214  0.86522948  0.5606821   0.5273375\n",
      "   1.22748297 -1.27705394 -0.40165729 -0.07846957  1.53203035  0.80958618\n",
      "   0.90429525  0.85052522 -0.12406847 -1.58160132  1.53203035  0.36264266\n",
      "   0.98760756  1.38320565  0.91726555 -0.24749538  1.42269911  1.31646531\n",
      "  -1.00798185  0.11221091  1.1550726   1.93818477  0.84485519  1.22748297\n",
      "   1.11413356  1.10095697  1.22181293 -0.36264266  0.5606821   0.58145314\n",
      "  -0.57967867  0.64819347  0.16432908  1.22748297  1.53203035  0.27366031\n",
      "  -0.63171474  0.91726555 -0.65827656  0.05809528 -0.65827656 -0.77909388\n",
      "   0.5606821   1.36456531 -1.24647954 -0.24026458 -0.65208904 -0.40165729\n",
      "   0.5606821  -1.40405878  1.11413356  1.36456531 -0.40784481  0.90429525\n",
      "   0.83188488  0.6538635   0.58145314  0.64654161 -0.01902951  1.69342306\n",
      "  -1.33116957  0.34364609  1.31646531  0.02322857 -0.0976274   1.1198036\n",
      "   0.21712009  1.22181293 -0.27513129  0.81111385  1.53203035 -0.07846957\n",
      "  -0.65208904  0.44124055  0.5606821   0.36264266  1.1550726   0.07292214\n",
      "  -0.03331166  0.89862521  0.84485519  1.20884263  1.53203035  0.5606821\n",
      "  -0.63790227  1.1676973   0.84485519 -0.39598725  0.9932776  -0.35372918\n",
      "   0.64819347  1.22748297  1.53203035 -0.65827656  0.5606821  -1.02662219\n",
      "   0.93811868 -0.39598725 -1.58160132  0.5606821   0.52166747  0.79073955\n",
      "  -0.32647673  1.22748297  1.1676973   0.27123572 -0.07424511 -1.33116957\n",
      "   0.91726555  0.54891992  0.6538635   0.59407783 -1.58160132 -0.40165729\n",
      "  -0.65208904 -0.02469954  1.53203035 -0.40784481  0.54030781  0.21712009\n",
      "  -0.95663642 -0.49069632 -0.01902951  1.1198036  -0.65827656  1.53203035\n",
      "   0.20691998  0.49937436  1.13595343 -0.01293737 -0.29542349  0.84485519\n",
      "   0.83188488  0.34364609  0.54030781  0.95675902  0.90429525  0.83188488\n",
      "  -0.65208904 -0.40165729 -1.58160132  0.38313956 -0.32924692  0.69768794\n",
      "   1.47224468  1.22748297  0.83188488  1.42269911 -0.65827656 -0.35372918\n",
      "  -0.01293737  1.53203035  0.95841088 -1.04249592  0.23749438  0.5606821\n",
      "   1.20719077  0.91726555 -0.10329743 -0.57967867  0.27123572  1.69342306\n",
      "   0.05809528 -0.65208904 -1.02662219  0.27123572  0.5606821 ]]\n",
      "total error:  0.23076923076923078 \n",
      "\n"
     ]
    }
   ],
   "source": [
    "dataMat, labelMat = loadDataSet('horseColicTraining2.txt')\n",
    "classifierArray = adaBoostTrainDS(dataMat, labelMat, 10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "16.0"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "testMat, testLabelMat = loadDataSet('horseColicTest2.txt')\n",
    "prediction10 = adaClassify(testMat, classifierArray)\n",
    "errMat = np.mat(np.ones((67,1)))\n",
    "errMat[prediction10 != testLabelMat].sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
